aboutsummaryrefslogtreecommitdiffstats
path: root/vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2024-01-28 19:28:42 +0100
committerGitHub <noreply@github.com>2024-01-28 19:28:42 +0100
commit6992a234c6e474dbe95e446bd1cdc50bdb452414 (patch)
tree17abc9faf9e43147ee195b0dbe9259eb361b3a6d /vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java
parent140ed00756d8b45ee622fdd61d2df91dd133133a (diff)
parentc824e1209fdd979612ccead027889eb6294b4652 (diff)
Merge pull request #30084 from vespa-engine/bratseth/tensor-cleanupv8.294.50
Minor cleanup
Diffstat (limited to 'vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java')
-rw-r--r--vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java b/vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java
index da643d8c173..8852bcd1ff3 100644
--- a/vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java
+++ b/vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java
@@ -4,13 +4,13 @@ package com.yahoo.tensor;
import com.yahoo.tensor.impl.Label;
/**
- * An address to a subset of a tensors' cells, specifying a label for some but not necessarily all of the tensors
+ * An address to a subset of a tensors' cells, specifying a label for some, but not necessarily all, of the tensors
* dimensions.
*
* @author bratseth
*/
// Implementation notes:
-// - These are created in inner (though not inner-most) loops so they are implemented with minimal allocation.
+// - These are created in inner (though not innermost) loops, so they are implemented with minimal allocation.
// We also avoid non-essential error checking.
// - We can add support for string labels later without breaking the API
public class PartialAddress {
@@ -36,7 +36,7 @@ public class PartialAddress {
for (int i = 0; i < dimensionNames.length; i++)
if (dimensionNames[i].equals(dimensionName))
return labels[i];
- return Tensor.INVALID_INDEX;
+ return Tensor.invalidIndex;
}
/** Returns the label of this dimension, or null if no label is specified for it */
@@ -68,7 +68,7 @@ public class PartialAddress {
long[] numericLabels = new long[labels.length];
for (int i = 0; i < type.dimensions().size(); i++) {
long label = numericLabel(type.dimensions().get(i).name());
- if (label == Tensor.INVALID_INDEX)
+ if (label == Tensor.invalidIndex)
throw new IllegalArgumentException(type + " dimension names does not match " + this);
numericLabels[i] = label;
}