Skip to content

Commit b037449

Browse files
committed
Style
1 parent b365b10 commit b037449

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/main/java/org/truffleruby/stdlib/bigdecimal/CreateBigDecimalNode.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -232,12 +232,9 @@ private Object getValueFromString(String string, int digits) {
232232
strValue = strValue.replaceFirst("[dD]", "E"); // 1. MRI allows d and D as exponent separators
233233
strValue = strValue.replaceAll("_", ""); // 2. MRI allows underscores anywhere
234234

235-
final MatchResult result;
236-
{
237-
final Matcher matcher = NUMBER_PATTERN.matcher(strValue);
238-
strValue = matcher.replaceFirst("$1"); // 3. MRI ignores the trailing junk
239-
result = matcher.toMatchResult();
240-
}
235+
final Matcher matcher = NUMBER_PATTERN.matcher(strValue);
236+
strValue = matcher.replaceFirst("$1"); // 3. MRI ignores the trailing junk
237+
final MatchResult result = matcher.toMatchResult();
241238

242239
try {
243240
final BigDecimal value = new BigDecimal(strValue, new MathContext(digits));
@@ -246,7 +243,6 @@ private Object getValueFromString(String string, int digits) {
246243
} else {
247244
return value;
248245
}
249-
250246
} catch (NumberFormatException e) {
251247
if (ZERO_PATTERN.matcher(strValue).matches()) {
252248
return BigDecimal.ZERO;

0 commit comments

Comments
 (0)