Paul Eggert wrote: > So, instead of this: > > if (flags >= 16) > type = TYPE_U32_STRING; > else if (flags >= 8) > type = TYPE_U16_STRING; > else > type = TYPE_U8_STRING; > > I might use something like the following, say. > > type = (flags < 8 ? TYPE_U8_STRING > : flags < 16 ? TYPE_U16_STRING > : TYPE_U32_STRING);
Sorry, but this is less understandable. There is a semantic relation between the 16 (= 'll') and TYPE_U32_STRING; and a semantic relation between the 8 (= 'l') and TYPE_U16_STRING. The way you write the expression, the things which are closely related are far apart in the code. Bruno