]> granicus.if.org Git - graphviz/commit
optimize 0 case in xdot_fmt_num
authorMatthew Fernandez <matthew.fernandez@gmail.com>
Fri, 14 May 2021 00:07:53 +0000 (17:07 -0700)
committerMatthew Fernandez <matthew.fernandez@gmail.com>
Thu, 20 May 2021 02:57:08 +0000 (19:57 -0700)
commitbc37b655bd4a976238f83439d9b1311a61a987a5
tree0d8e46bd082b8b57cfcb5987846a3157b54408a2
parent5e2a83a8ddf28795f5b27381c9f30f9d324b26d9
optimize 0 case in xdot_fmt_num

Commit 894e94c66340187ff6f8ea97c9336ea048a3d6ad applied a performance
optimization to gvprintdouble that was contributing to a performance issue in a
user’s graph. The code touched in this commit has the same pattern as that in
gvprintdouble, and the same corresponding (latent) performance issue. While it
is not known to cause any problems currently, we may as well proactively apply
the same optimization here.

This preserves the same functionality, but simply takes an early exit from the
function when we already know precisely how to print the resulting string.
plugin/core/gvrender_core_dot.c