This patch includes speed-ups for match in the case of a scalar x and NULL incomparables. For these cases constructing a hash is not necessary.

runs = 1:1e6
system.time( for (i in runs) { match("A",LETTERS, incomparables=NULL) } )
##    user  system elapsed 
##   2.164   0.000   2.173
system.time( for (i in runs) { match("Z",LETTERS, incomparables=NULL) } )
##    user  system elapsed 
##   2.069   0.000   2.074
system.time( for (i in runs) { match("A",LETTERS, incomparables="FOO") } )
##    user  system elapsed 
##   3.098   0.001   3.109
system.time( for (i in runs) { match("Z",LETTERS, incomparables="FOO") } )
##    user  system elapsed 
##   3.271   0.000   3.282
range = 1:24
system.time( for (i in runs) { match(1,range, incomparables=NULL) } )
##    user  system elapsed 
##   2.210   0.000   2.218
system.time( for (i in runs) { match(26,range, incomparables=NULL) } )
##    user  system elapsed 
##   2.331   0.001   2.335
system.time( for (i in runs) { match(1,range, incomparables=2) } )
##    user  system elapsed 
##   3.747   0.002   3.758
system.time( for (i in runs) { match(1,range, incomparables=2) } )
##    user  system elapsed 
##   3.968   0.000   3.981
stopifnot( match("A",LETTERS, incomparables=NULL) == 1 )
stopifnot( match("Z",LETTERS, incomparables=NULL) == 26 )
stopifnot( match(15,11:100, incomparables=NULL) == 5 )
stopifnot( match(15L,11L:100L, incomparables=NULL) == 5 )
stopifnot( is.na(match("FOO", LETTERS, incomparables=NULL)) )
stopifnot( is.na(match(7, 11:20, incomparables=NULL)) )