avoid linear-time if/else special cases in sysconf
authorRich Felker <dalias@aerifal.cx>
Tue, 15 Apr 2014 17:30:20 +0000 (13:30 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 15 Apr 2014 17:30:20 +0000 (13:30 -0400)
commit233767b48a083f526557ee39aa1c773efa345972
treeedee31b5097d4a1dc594975e5e82cf903d9083e3
parent805698401dbac7ce3079fa97eaad5ba0508377f4
avoid linear-time if/else special cases in sysconf

the previous handling of cases that could not fit in the 16-bit table
or which required non-constant results was extremely ugly and could
not scale. the new code remaps these keys into a contiguous range
that's efficient for a switch statement.
src/conf/sysconf.c