Skip to content

Commit

Permalink
Improve XML scanner memory
Browse files Browse the repository at this point in the history
Signed-off-by: azerr <azerr@redhat.com>
  • Loading branch information
azerr authored and angelozerr committed May 23, 2022
1 parent 420076e commit 65dc7dc
Show file tree
Hide file tree
Showing 3 changed files with 162 additions and 136 deletions.
Expand Up @@ -126,7 +126,7 @@ public boolean advanceIfChar(int ch) {
return false;
}

public boolean advanceIfChars(int... ch) {
public boolean advanceIfChars(int[] ch) {
int i;
if (this.position + ch.length > this.len) {
return false;
Expand All @@ -140,7 +140,7 @@ public boolean advanceIfChars(int... ch) {
return true;
}

public int advanceIfAnyOfChars(int... ch) {
public int advanceIfAnyOfChars(int[] ch) {
int i;
if (this.position + 1 > this.len) {
return -1;
Expand Down Expand Up @@ -198,7 +198,7 @@ public boolean advanceUntilChar(int ch) {
/**
* Will advance until any of the provided chars are encountered
*/
public boolean advanceUntilAnyOfChars(int... ch) {
public boolean advanceUntilAnyOfChars(int[] ch) {
while (this.position < this.len) {
for (int i = 0; i < ch.length; i++) {
if (peekChar() == ch[i]) {
Expand Down Expand Up @@ -258,7 +258,7 @@ else if(peekChar() == closingBracket) {
return false;
}

public boolean advanceUntilChars(int... ch) {
public boolean advanceUntilChars(int[] ch) {
while (this.position + ch.length <= this.len) {
int i = 0;
for (; i < ch.length && peekChar(i) == ch[i]; i++) {
Expand All @@ -276,7 +276,7 @@ public boolean advanceUntilChars(int... ch) {
* Advances until it matches int[] ch OR it hits '<' If this returns true, peek
* if next char is '<' to check which case was hit
*/
public boolean advanceUntilCharsOrNewTag(int... ch) {
public boolean advanceUntilCharsOrNewTag(int[] ch) {
while (this.position + ch.length <= this.len) {
int i = 0;
if (peekChar(0) == _LAN) { // <
Expand Down

0 comments on commit 65dc7dc

Please sign in to comment.