We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 131ce7f commit 3db4bc5Copy full SHA for 3db4bc5
bindings/java/org/nexusformat/NexusFile.java
@@ -541,20 +541,15 @@ public Hashtable attrdir() throws NexusException {
541
int rank = args[0];
542
int type = args[1];
543
String name = names[0];
544
+ int length = 1;
545
int[] thedims = new int[rank];
546
for(int i = 0 ; i < rank ; i++) {
- thedims[i] = dim[i];
547
+ thedims[i] = dim[i];
548
+ length *= dim[i];
549
}
-
550
at = new AttributeEntry();
551
at.dim = thedims;
- if (rank == 0) {
552
- at.length = 1;
553
- } if (rank == 1) {
554
- at.length = dim[0];
555
- } else {
556
- at.length = 0;
557
- }
+ at.length = length;
558
at.type = type;
559
h.put(name, at);
560
0 commit comments