Skip to content

Commit

Permalink
Corrected grammar.
Browse files Browse the repository at this point in the history
  • Loading branch information
uhop committed Jun 8, 2024
1 parent 675a4cd commit 55f6c37
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions lib/addon.cc
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ const StrVal& WrappedRE2::prepareArgument(const v8::Local<v8::Value> &arg, bool

void StrVal::setIndex(size_t newIndex)
{
isIndexValid = newIndex <= length;
if (!isIndexValid)
isValidIndex = newIndex <= length;
if (!isValidIndex)
{
index = newIndex;
byteIndex = 0;
Expand Down
2 changes: 1 addition & 1 deletion lib/exec.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ NAN_METHOD(WrappedRE2::Exec)

if (re2->global || re2->sticky)
{
if (!str.isIndexValid)
if (!str.isValidIndex)
{
re2->lastIndex = 0;
info.GetReturnValue().SetNull();
Expand Down
2 changes: 1 addition & 1 deletion lib/match.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ NAN_METHOD(WrappedRE2::Match)
auto str = re2->prepareArgument(info[0], re2->global);
if (str.isBad) return; // throws an exception

if (!str.isIndexValid)
if (!str.isValidIndex)
{
re2->lastIndex = 0;
info.GetReturnValue().SetNull();
Expand Down
2 changes: 1 addition & 1 deletion lib/replace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ NAN_METHOD(WrappedRE2::Replace)
auto replacee = re2->prepareArgument(info[0]);
if (replacee.isBad) return; // throws an exception

if (!replacee.isIndexValid)
if (!replacee.isValidIndex)
{
info.GetReturnValue().Set(info[0]);
return;
Expand Down
2 changes: 1 addition & 1 deletion lib/test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ NAN_METHOD(WrappedRE2::Test)
return;
}

if (!str.isIndexValid)
if (!str.isValidIndex)
{
re2->lastIndex = 0;
info.GetReturnValue().SetNull();
Expand Down
6 changes: 3 additions & 3 deletions lib/wrapped_re2.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ struct StrVal
char *data;
size_t size, length;
size_t index, byteIndex;
bool isBuffer, isIndexValid, isBad;
bool isBuffer, isValidIndex, isBad;

StrVal() : data(NULL), size(0), length(0), index(0), byteIndex(0), isBuffer(false), isIndexValid(false), isBad(false) {}
StrVal() : data(NULL), size(0), length(0), index(0), byteIndex(0), isBuffer(false), isValidIndex(false), isBad(false) {}

operator re2::StringPiece() const { return re2::StringPiece(data, size); }

Expand All @@ -20,7 +20,7 @@ struct StrVal

void clear()
{
isBad = isBuffer = isIndexValid = false;
isBad = isBuffer = isValidIndex = false;
size = length = index = byteIndex = 0;
data = nullptr;
}
Expand Down

0 comments on commit 55f6c37

Please sign in to comment.