Age | Commit message (Collapse) | Author | Files | Lines |
|
- String hashing needs to walk the entire string anyhow, might as well
take advantage of this and have it return the string length to avoid
having to separately call strlen() in the cases where this matters.
- Move the implementation into rpmstrpool.c for inlining possibilities,
rstrhash() is now just a wrapper to rstrlenhash(). The generic
hash implementation could not take advantage of this anyway really.
|
|
|
|
- There are places in rpmio and build that would benefit from hashing, but
hashFunctionString() being internal to librpm has prevented that. Rename
to rstrhash() to resemble the other foo in rpmstring.h for
minimal namespacing as its now public function and update callers.
- Also mark the function as "pure" - it only looks at its arguments.
This is one of the busiest functions in entire rpm so any optimization
no matter how minor is well worth it.
- Hereby awarding hashFunctionString() with the grand prize for
the Most Moved Around Function in rpm ;)
|
|
- There used to be some other callers too but seems they've passed
away, leaving just the relocation code in rpmte.c. Which means we
can get this ugly bit out of the API.
|
|
|
|
|
|
|
|
- use ARGV_t instead, it does the same and more...
|
|
- adopted from strlcpy() function of OpenBSD originally developed by
Todd C. Miller <Todd.Miller@courtesan.com>
|
|
- concatenates NULL terminated strings to newly (re)allocated memory
- purpose is to prevent overflows caused by writing unknown-sized stuff
to static arrays
|
|
|
|
- should probably change the comment to "simple, stupid and buggy" ;)
|
|
|
|
|
|
|
|
|
|
- adjust include paths accordingly
|
|
|
|
- splitString, freeSplitString, stripTrailingChar
|
|
- rename header to more generic rpmstring.h for collecting misc string
helper functions
|