* optimize code for rpc whitelist

Change-Id: I0002b704bff879656b6962d8869dcdf39f81d978