Skip to content

Commit

Permalink
code cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
rbri committed Dec 2, 2023
1 parent 6f05b91 commit 4134991
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/htmlunit/xpath/axes/NodeSequence.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ private IteratorCache getCache() {
}

/** Set the vector where nodes will be cached. */
protected void SetVector(NodeVector v) {
protected void setVector(NodeVector v) {
setObject(v);
}

Expand Down Expand Up @@ -129,7 +129,7 @@ public final void setIter(DTMIterator iter) {
public NodeSequence(Object nodeVector) {
super(nodeVector);
if (nodeVector instanceof NodeVector) {
SetVector((NodeVector) nodeVector);
setVector((NodeVector) nodeVector);
}
if (null != nodeVector) {
assertion(
Expand Down Expand Up @@ -311,9 +311,9 @@ public boolean isFresh() {
public void setShouldCacheNodes(boolean b) {
if (b) {
if (!hasCache()) {
SetVector(new NodeVector());
setVector(new NodeVector());
}
} else SetVector(null);
} else setVector(null);
}

/** {@inheritDoc} */
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/htmlunit/xpath/objects/XNodeSet.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ public NodeList nodelist() throws javax.xml.transform.TransformerException {
// from m_iter after this call. As a fix, we call SetVector() on the clone's
// cache. See Bugzilla 14406.
XNodeSet clone = (XNodeSet) nodelist.getDTMIterator();
SetVector(clone.getVector());
setVector(clone.getVector());
return nodelist;
}

Expand Down
18 changes: 0 additions & 18 deletions src/main/java/org/htmlunit/xpath/xml/utils/NodeVector.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,6 @@ public void addElement(int value) {
m_firstFree++;
}

/**
* Return the node at the top of the stack without popping the stack. Special purpose method for
* TransformerImpl, pushElemTemplateElement. Performance critical.
*
* @return Node at the top of the stack or null if stack is empty.
*/
public final int peepOrNull() {
return ((null != m_map) && (m_firstFree > 0)) ? m_map[m_firstFree - 1] : DTM.NULL;
}

/**
* Inserts the specified node in this vector at the specified index. Each component in this vector
* with an index greater or equal to the specified index is shifted upward to have an index one
Expand Down Expand Up @@ -149,14 +139,6 @@ public void insertElementAt(int value, int at) {
m_firstFree++;
}

/** Set the length to zero, but don't clear the array. */
public void RemoveAllNoClear() {

if (null == m_map) return;

m_firstFree = 0;
}

/**
* Get the nth element.
*
Expand Down

0 comments on commit 4134991

Please sign in to comment.