diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2024-01-28 19:28:42 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-28 19:28:42 +0100 |
commit | 6992a234c6e474dbe95e446bd1cdc50bdb452414 (patch) | |
tree | 17abc9faf9e43147ee195b0dbe9259eb361b3a6d /vespajlib/src/main/java/com/yahoo/tensor/PartialAddress.java | |
parent | 140ed00756d8b45ee622fdd61d2df91dd133133a (diff) | |
parent | c824e1209fdd979612ccead027889eb6294b4652 (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.java | 8 |
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; } |