src/string_piece.cc
// For each character in characters_wanted, sets the index corresponding
// to the ASCII code of that character to 1 in table.  This is used by
// the find_.*_of methods below to tell whether or not a character is in
// the lookup table in constant time.
// The argument `table' must be an array that is large enough to hold all
// the possible values of an unsigned char.  Thus it should be be declared
// as follows:
//   bool table[UCHAR_MAX + 1]
For each character in characters_wanted, sets the index corresponding
to the ASCII code of that character to 1 in table.  This is used by
the find_.*_of methods below to tell whether or not a character is in
the lookup table in constant time.
The argument `table' must be an array that is large enough to hold all
the possible values of an unsigned char.  Thus it should be be declared
as follows:
bool table[UCHAR_MAX + 1]
For each character in characters_wanted sets the index corresponding to the ASCII code of that character to 1 in table . This is used by the find_ . * _of methods below to tell whether or not a character is in the lookup table in constant time . The argument ` table ' must be an array that is large enough to hold all the possible values of an unsigned char . Thus it should be be declared as follows : bool table [ UCHAR_MAX + 1 ]
static inline void BuildLookupTable(const StringPiece& characters_wanted,
                                    bool* table) {
  const size_type length = characters_wanted.length();
  const char* const data = characters_wanted.data();
  for (size_type i = 0; i < length; ++i) {
    table[static_cast<unsigned char>(data[i])] = true;
  }
}
static inline void BuildLookupTable ( const StringPiece & characters_wanted , bool * table ) { const size_type length = characters_wanted . length ( ) ; const char * const data = characters_wanted . data ( ) ; for ( size_type i = 0 ; i < length ; ++ i ) { table [ static_cast < unsigned char > ( data [ i ] ) ] = true ; } }
For each character in characters_wanted, sets the index corresponding
to the ASCII code of that character to 1 in table.
For each character in characters_wanted sets the index corresponding to the ASCII code of that character to 1 in table .