fixed the bug in sort a stack

condition statements are not equal, aware the short-circuit