bool.cpp optimization