Refactor rshift()

It is unnecessary to assign temp value.
I reduced a nesting.