Skip to content

Commit 07a9d0f

Browse files
committed
Remove extra Quantity.fromString() call
in Quantity constructor. Avoid doing extra work. We only need to call it once.
1 parent cda3746 commit 07a9d0f

File tree

1 file changed

+3
-2
lines changed
  • kubernetes/src/main/java/io/kubernetes/client/custom

1 file changed

+3
-2
lines changed

kubernetes/src/main/java/io/kubernetes/client/custom/Quantity.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,9 @@ public Quantity(final BigDecimal number, final Format format) {
3737
}
3838

3939
public Quantity(final String value) {
40-
this.number = fromString(value).number;
41-
this.format = fromString(value).format;
40+
final Quantity quantity = fromString(value);
41+
this.number = quantity.number;
42+
this.format = quantity.format;
4243
}
4344

4445
public BigDecimal getNumber() {

0 commit comments

Comments
 (0)