docs/scripts/sunlight.js
function createHashMap(wordMap, boundary, caseInsensitive) {
		//creates a hash table where the hash is the first character of the word
		var newMap = { },
			i,
			word,
			firstChar;
		
		for (i = 0; i < wordMap.length; i++) {
			word = caseInsensitive ? wordMap[i].toUpperCase() : wordMap[i];
			firstChar = word.charAt(0);
			if (!newMap[firstChar]) {
				newMap[firstChar] = [];
			}

			newMap[firstChar].push({ value: word, regex: new RegExp("^" + regexEscape(word) + boundary, caseInsensitive ? "i" : "") });
		}

		return newMap;
	}
function createHashMap(wordMap, boundary, caseInsensitive) {
		//creates a hash table where the hash is the first character of the word
		var newMap = { },
			i,
			word,
			firstChar;
		
		for (i = 0; i < wordMap.length; i++) {
			word = caseInsensitive ? wordMap[i].toUpperCase() : wordMap[i];
			firstChar = word.charAt(0);
			if (!newMap[firstChar]) {
				newMap[firstChar] = [];
			}

			newMap[firstChar].push({ value: word, regex: new RegExp("^" + regexEscape(word) + boundary, caseInsensitive ? "i" : "") });
		}

		return newMap;
	}
function createHashMap ( wordMap , boundary , caseInsensitive ) { //creates a hash table where the hash is the first character of the word var newMap = { } , i , word , firstChar ; for ( i = 0 ; i < wordMap . length ; i ++ ) { word = caseInsensitive ? wordMap [ i ] . toUpperCase ( ) : wordMap [ i ] ; firstChar = word . charAt ( 0 ) ; if ( ! newMap [ firstChar ] ) { newMap [ firstChar ] = [ ] ; } newMap [ firstChar ] . push ( { value : word , regex : new RegExp ( "^" + regexEscape ( word ) + boundary , caseInsensitive ? "i" : "" ) } ) ; } return newMap ; }
this is crucial for performance
this is crucial for performance