]> sourceware.org Git - lvm2.git/commit
Optimise _eat_space and _get_token
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 10 Mar 2011 14:51:35 +0000 (14:51 +0000)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 10 Mar 2011 14:51:35 +0000 (14:51 +0000)
commit685e54f4dd7e8387f6fba3c691063021303ffe19
tree42d0480255b7e439a3c09eff5c7c1d85c7957747
parentf84700a1828141d3edd98b7d6de3fe30781ad256
Optimise _eat_space and _get_token

Makes the code more readable and has a smaller number of memory
accesses thus it's small optimisation as well.

For _get_token() optimize number parsing. Check for '.' char only
if it's not a digit. Move pointer incrementation into one place.

For _eat_space() check only p->te for '\0' in skipping of comment line.
Avoid check for '\0' when we know it is space. Also master while loop
doesn't need checking p->tb for '\0'. We just need to check p->tb
isn't already at the end of buffer. This could give 'extra' loop cycle
if we are already there - but safes memory access in every other case.
WHATS_NEW
lib/config/config.c
This page took 0.035328 seconds and 5 git commands to generate.