]> git.ipfire.org Git - thirdparty/coreutils.git/commit
cut: avoid a redundant heap allocation
authorCojocaru Alexandru <xojoc@gmx.com>
Thu, 6 Dec 2012 02:03:41 +0000 (03:03 +0100)
committerPádraig Brady <P@draigBrady.com>
Thu, 6 Dec 2012 18:29:23 +0000 (18:29 +0000)
commitec48beadfa0ae1216788eaf6bf558ee2013eac18
tree91642fbcf559a72c1cb8b3140a45fe91a84ab9a9
parent00743a1f6e18ab5dfd6957eca638d4f670326f9b
cut: avoid a redundant heap allocation

* src/cut.c (set_fields): Don't allocate memory for
`printable_field' if there are no finite ranges.
This is achieved by keeping max_range_endpoint as 0 when
there are no finite ranges.  max_range_endpoint is then
used throughout the code to guard against allocation of,
and access to the bit array.
The extra allocation was introduced via commit v8.10-3-g2e636af.
src/cut.c