Skip to content

Commit db61dba

Browse files
dota17baylesj
authored andcommitted
Improving Code Readability (open-source-parsers#1004)
1 parent 7ef0f9f commit db61dba

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

include/json/reader.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ class [[deprecated("deprecated Use CharReader and CharReaderBuilder.")]] JSON_AP
193193

194194
bool readToken(Token& token);
195195
void skipSpaces();
196-
bool match(Location pattern, int patternLength);
196+
bool match(const Char* pattern, int patternLength);
197197
bool readComment();
198198
bool readCStyleComment();
199199
bool readCppStyleComment();

src/lib_json/json_reader.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ void Reader::skipSpaces() {
324324
}
325325
}
326326

327-
bool Reader::match(Location pattern, int patternLength) {
327+
bool Reader::match(const Char* pattern, int patternLength) {
328328
if (end_ - current_ < patternLength)
329329
return false;
330330
int index = patternLength;
@@ -416,7 +416,7 @@ bool Reader::readCppStyleComment() {
416416
}
417417

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

957957
bool readToken(Token& token);
958958
void skipSpaces();
959-
bool match(Location pattern, int patternLength);
959+
bool match(const Char* pattern, int patternLength);
960960
bool readComment();
961961
bool readCStyleComment();
962962
bool readCppStyleComment();
@@ -1287,7 +1287,7 @@ void OurReader::skipSpaces() {
12871287
}
12881288
}
12891289

1290-
bool OurReader::match(Location pattern, int patternLength) {
1290+
bool OurReader::match(const Char* pattern, int patternLength) {
12911291
if (end_ - current_ < patternLength)
12921292
return false;
12931293
int index = patternLength;
@@ -1380,7 +1380,7 @@ bool OurReader::readCppStyleComment() {
13801380
}
13811381

13821382
bool OurReader::readNumber(bool checkInf) {
1383-
const char* p = current_;
1383+
Location p = current_;
13841384
if (checkInf && p != end_ && *p == 'I') {
13851385
current_ = ++p;
13861386
return false;

0 commit comments

Comments
 (0)