sstring.h
/**
	 * Set the first len elements of the buffer to el.
	 */
Set the first len elements of the buffer to el.
Set the first len elements of the buffer to el .
void fill(size_t len, char el) {
		assert_leq(len, len_);
		assert_range(0, 3, (int)el);
		size_t word = 0;
		if(len > 32) {
			uint32_t bl = (uint32_t)el;
			bl |= (bl << 2);
			bl |= (bl << 4);
			bl |= (bl << 8);
			bl |= (bl << 16);
			size_t blen = len >> 4;
			for(; word < blen; word++) {
				cs_[word] = bl;
			}
			len = len & 15;
		}
		size_t bp = 0;
		for(size_t i = 0; i < len; i++) {
			cs_[word] &= ~(uint32_t)(3  << (bp << 1));
			cs_[word] |=  (uint32_t)(el << (bp << 1));
			if(bp == 15) {
				word++;
				bp = 0;
			} else bp++;
		}
	}
void fill ( size_t len , char el ) { assert_leq ( len , len_ ) ; assert_range ( 0 , 3 , ( int ) el ) ; size_t word = 0 ; if ( len > 32 ) { uint32_t bl = ( uint32_t ) el ; bl |= ( bl << 2 ) ; bl |= ( bl << 4 ) ; bl |= ( bl << 8 ) ; bl |= ( bl << 16 ) ; size_t blen = len >> 4 ; for ( ; word < blen ; word ++ ) { cs_ [ word ] = bl ; } len = len & 15 ; } size_t bp = 0 ; for ( size_t i = 0 ; i < len ; i ++ ) { cs_ [ word ] &= ~ ( uint32_t ) ( 3 << ( bp << 1 ) ) ; cs_ [ word ] |= ( uint32_t ) ( el << ( bp << 1 ) ) ; if ( bp == 15 ) { word ++ ; bp = 0 ; } else bp ++ ; } }
Set the first len elements of the buffer to el.
Set the first len elements of the buffer to el .
// Copy el throughout block // Fill with blocks