Skip to content

Improving Code Readability : change variable's type #1004

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 16, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/json/reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class [[deprecated("deprecated Use CharReader and CharReaderBuilder.")]] JSON_AP

bool readToken(Token& token);
void skipSpaces();
bool match(Location pattern, int patternLength);
bool match(const Char* pattern, int patternLength);
bool readComment();
bool readCStyleComment();
bool readCppStyleComment();
Expand Down
10 changes: 5 additions & 5 deletions src/lib_json/json_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ void Reader::skipSpaces() {
}
}

bool Reader::match(Location pattern, int patternLength) {
bool Reader::match(const Char* pattern, int patternLength) {
if (end_ - current_ < patternLength)
return false;
int index = patternLength;
Expand Down Expand Up @@ -416,7 +416,7 @@ bool Reader::readCppStyleComment() {
}

void Reader::readNumber() {
const char* p = current_;
Location p = current_;
char c = '0'; // stopgap for already consumed character
// integral part
while (c >= '0' && c <= '9')
Expand Down Expand Up @@ -956,7 +956,7 @@ class OurReader {

bool readToken(Token& token);
void skipSpaces();
bool match(Location pattern, int patternLength);
bool match(const Char* pattern, int patternLength);
bool readComment();
bool readCStyleComment();
bool readCppStyleComment();
Expand Down Expand Up @@ -1287,7 +1287,7 @@ void OurReader::skipSpaces() {
}
}

bool OurReader::match(Location pattern, int patternLength) {
bool OurReader::match(const Char* pattern, int patternLength) {
if (end_ - current_ < patternLength)
return false;
int index = patternLength;
Expand Down Expand Up @@ -1380,7 +1380,7 @@ bool OurReader::readCppStyleComment() {
}

bool OurReader::readNumber(bool checkInf) {
const char* p = current_;
Location p = current_;
if (checkInf && p != end_ && *p == 'I') {
current_ = ++p;
return false;
Expand Down