improving performance of sameStart()

see http://jsperf.com/determine-common-beginning for benefits