strtok源码 bitset 空间压缩

源代码里有一段:

unsigned char map[32];  
/* Clear control map */  
for (count = 0; count < 32; count++)  
map[count] = 0;  
  
/* Set bits in delimiter table */  
do {  
    map[*ctrl >> 3] |= (1 << (*ctrl & 7));  
} while (*ctrl++);  

这段代码用于计算哪些字符需要分割。map实际上是一个压缩过的哈希表bool flag[255],通过位运算实现的bitset。

原文地址:https://www.cnblogs.com/jt2001/p/6127483.html