projects
/
folly.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
clang attribute wrappers
[folly.git]
/
folly
/
String-inl.h
diff --git
a/folly/String-inl.h
b/folly/String-inl.h
index 52b665c75e6e662d464fa65ba42dfb18999f9078..1a4edb7d949aeb93c20ba29849a7371bd1aedc97 100644
(file)
--- a/
folly/String-inl.h
+++ b/
folly/String-inl.h
@@
-1,5
+1,5
@@
/*
/*
- * Copyright 201
4
Facebook, Inc.
+ * Copyright 201
5
Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@
-203,7
+203,6
@@
void uriUnescape(StringPiece str, String& out, UriEscapeMode mode) {
// this is faster than calling push_back repeatedly.
while (p != str.end()) {
char c = *p;
// this is faster than calling push_back repeatedly.
while (p != str.end()) {
char c = *p;
- unsigned char v = static_cast<unsigned char>(v);
switch (c) {
case '%':
{
switch (c) {
case '%':
{
@@
-320,9
+319,9
@@
void internalSplit(DelimT delim, StringPiece sp, OutputIterator out,
ignoreEmpty);
}
ignoreEmpty);
}
-
in
t tokenStartPos = 0;
-
in
t tokenSize = 0;
- for (
in
t i = 0; i <= strSize - dSize; ++i) {
+
size_
t tokenStartPos = 0;
+
size_
t tokenSize = 0;
+ for (
size_
t i = 0; i <= strSize - dSize; ++i) {
if (atDelim(&s[i], delim)) {
if (!ignoreEmpty || tokenSize > 0) {
*out++ = conv(StringPiece(&s[tokenStartPos], tokenSize));
if (atDelim(&s[i], delim)) {
if (!ignoreEmpty || tokenSize > 0) {
*out++ = conv(StringPiece(&s[tokenStartPos], tokenSize));
@@
-335,9
+334,8
@@
void internalSplit(DelimT delim, StringPiece sp, OutputIterator out,
++tokenSize;
}
}
++tokenSize;
}
}
-
+ tokenSize = strSize - tokenStartPos;
if (!ignoreEmpty || tokenSize > 0) {
if (!ignoreEmpty || tokenSize > 0) {
- tokenSize = strSize - tokenStartPos;
*out++ = conv(StringPiece(&s[tokenStartPos], tokenSize));
}
}
*out++ = conv(StringPiece(&s[tokenStartPos], tokenSize));
}
}
@@
-568,8
+566,8
@@
void backslashify(const String1& input, String2& output, bool hex_style) {
template <class String1, class String2>
void humanify(const String1& input, String2& output) {
template <class String1, class String2>
void humanify(const String1& input, String2& output) {
-
in
t numUnprintable = 0;
-
in
t numPrintablePrefix = 0;
+
size_
t numUnprintable = 0;
+
size_
t numPrintablePrefix = 0;
for (unsigned char c : input) {
if (c < 0x20 || c > 0x7e || c == '\\') {
++numUnprintable;
for (unsigned char c : input) {
if (c < 0x20 || c > 0x7e || c == '\\') {
++numUnprintable;
@@
-616,9
+614,9
@@
bool hexlify(const InputString& input, OutputString& output,
if (!append_output) output.clear();
static char hexValues[] = "0123456789abcdef";
if (!append_output) output.clear();
static char hexValues[] = "0123456789abcdef";
-
int
j = output.size();
+
auto
j = output.size();
output.resize(2 * input.size() + output.size());
output.resize(2 * input.size() + output.size());
- for (
in
t i = 0; i < input.size(); ++i) {
+ for (
size_
t i = 0; i < input.size(); ++i) {
int ch = input[i];
output[j++] = hexValues[(ch >> 4) & 0xf];
output[j++] = hexValues[ch & 0xf];
int ch = input[i];
output[j++] = hexValues[(ch >> 4) & 0xf];
output[j++] = hexValues[ch & 0xf];
@@
-640,7
+638,7
@@
bool unhexlify(const InputString& input, OutputString& output) {
-1;
};
-1;
};
- for (
in
t i = 0; i < input.size(); i += 2) {
+ for (
size_
t i = 0; i < input.size(); i += 2) {
int highBits = unhex(input[i]);
int lowBits = unhex(input[i + 1]);
if (highBits < 0 || lowBits < 0) {
int highBits = unhex(input[i]);
int lowBits = unhex(input[i + 1]);
if (highBits < 0 || lowBits < 0) {