some features
in main.cpp fastest Variant implementation
This commit is contained in:
@@ -371,4 +371,7 @@
|
||||
* \fn bool PIMapIterator::next()
|
||||
* \brief Jump to next entry and return if new position is valid.
|
||||
|
||||
* \fn void PIMapIterator::reset()
|
||||
* \brief Reset iterator to initial position.
|
||||
|
||||
* */
|
||||
|
||||
@@ -364,6 +364,13 @@ public:
|
||||
}
|
||||
return false;
|
||||
}
|
||||
inline void reset() {
|
||||
if (rev) {
|
||||
pos = m.size_s();
|
||||
} else {
|
||||
pos = -1;
|
||||
}
|
||||
}
|
||||
private:
|
||||
const MapType & m;
|
||||
ssize_t pos;
|
||||
|
||||
@@ -467,7 +467,7 @@ uint letobe_i(uint v) {return (v >> 24) | ((v >> 8) & 0xFF00) | ((v << 8) & 0xFF
|
||||
|
||||
#endif
|
||||
|
||||
/// \brief Generic hash function, impements murmur3/32 algorithm
|
||||
/// \brief Generic hash function, implements murmur3/32 algorithm
|
||||
inline uint piHashData(const uchar * data, uint len, uint seed = 0) {
|
||||
if (!data || len <= 0) return 0u;
|
||||
uint h = seed;
|
||||
|
||||
@@ -337,6 +337,16 @@ public:
|
||||
* \sa \a expandRightTo() */
|
||||
PIString & expandLeftTo(const int len, const PIChar c) {if (len > length()) insert(0, PIString(len - length(), c)); return *this;}
|
||||
|
||||
/*! \brief Enlarge and returns copy of this string to length "len"
|
||||
* by addition sequence of symbols "c" at the end of string
|
||||
* \sa \a expandRightTo() */
|
||||
PIString expandedRightTo(const int len, const PIChar c) const {return PIString(*this).expandRightTo(len, c);}
|
||||
|
||||
/*! \brief Enlarge and returns copy of this string to length "len"
|
||||
* by addition sequence of symbols "c" at the beginning of string
|
||||
* \sa \a expandLeftTo() */
|
||||
PIString expandedLeftTo(const int len, const PIChar c) const {return PIString(*this).expandLeftTo(len, c);}
|
||||
|
||||
/*! \brief Add "c" symbols at the beginning and end of the string, and return this string
|
||||
* \sa \a quoted() */
|
||||
PIString & quote(PIChar c = PIChar('"')) {insert(0, c); *this += c; return *this;}
|
||||
|
||||
Reference in New Issue
Block a user