I've tested that this still works in python mode, which was the reason for making the cigar operation functions not inline.
I haven't benchmarked the performance difference, but switching the existing code for more bit operations, fewer assigned temporary variables, and a string constant for the map can't be slower than the current impementation.
I also modified one string format parameter. (I replaced %i with%lu to eliminate the compiler warning.)
I've tested that this still works in python mode, which was the reason for making the cigar operation functions not inline.
I haven't benchmarked the performance difference, but switching the existing code for more bit operations, fewer assigned temporary variables, and a string constant for the map can't be slower than the current impementation.
I also modified one string format parameter. (I replaced %i with%lu to eliminate the compiler warning.)