lastOccurrence[static_cast<uchar>(*(patternBegin + i))] = patternSize - i - 1;
TIterator it = dataBegin + patternSize - 1 + offset;
- while(true)
- {
+ while(true) {
TIterator itBuffer = it;
TIterator itPattern = patternBegin + patternSize - 1;
- while(*itBuffer == *itPattern)
- {
- if(itPattern == patternBegin)
- {
+ while(*itBuffer == *itPattern) {
+ if(itPattern == patternBegin) {
if((itBuffer - dataBegin - offset) % byteAlign == 0)
return (itBuffer - dataBegin);
else
template <typename TFloat, typename TInt, Utils::ByteOrder ENDIAN>
TFloat toFloat(const ByteVector &v, size_t offset)
{
- if (offset > v.size() - sizeof(TInt)) {
+ if(offset > v.size() - sizeof(TInt)) {
debug("toFloat() - offset is out of range. Returning 0.");
return 0.0;
}
StringList String::split(const String &separator) const
{
StringList list;
- for(int index = 0;;)
- {
+ for(int index = 0;;) {
int sep = find(separator, index);
- if(sep < 0)
- {
+ if(sep < 0) {
list.append(substr(index, size() - index));
break;
}
- else
- {
+ else {
list.append(substr(index, sep - index));
index = sep + separator.size();
}
{
const wchar_t *p = toCWString();
- while(*p != L'\0' || *s != '\0')
- {
+ while(*p != L'\0' || *s != '\0') {
if(*p++ != static_cast<uchar>(*s++))
return false;
}
bool String::operator==(const wchar_t *s) const
{
- return (::wcscmp(toCWString(), s) == 0);
+ return (d->data == s);
}
bool String::operator!=(const wchar_t *s) const