remove unnecessary case in R.func