you can also sort codes and use std::binary_search