]> granicus.if.org Git - graphviz/commit
graphml2gv: undo micro-optimization in 'endElementHandler'
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Mon, 9 May 2022 00:10:48 +0000 (17:10 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 19 May 2022 23:59:18 +0000 (16:59 -0700)
commite20e7482680cf3a62d7aaae9a140a4331ba46c41
treed4cd328cdc01266787ff66b8c3c83dbde634abaf
parent4185de93ba7b3cb7fec4bc99a86492718a911d0c
graphml2gv: undo micro-optimization in 'endElementHandler'

This code was deciding between using a static stack buffer and a dynamic heap
buffer depending on the length of the string it needed to deal with. This kind
of optimization is unnecessary on modern platforms with performant allocators.
The branching and structure duplication involved in this is often now a
_de-optimization_ instead of the intended optimization.

This commit undoes this trick and instead unconditionally uses heap allocation.
cmd/tools/graphml2gv.c