GREEN: Fix single number parsing bug
- Removed +1 off-by-one error from single number parsing - Now correctly returns the parsed number - Tests pass: '5' returns 5, '42' returns 42
This commit is contained in:
parent
d30267bcc6
commit
77d48e790a
1 changed files with 1 additions and 1 deletions
|
|
@ -17,7 +17,7 @@ class StringCalculator {
|
|||
|
||||
// Bug 2: Single number parsing
|
||||
if (!numbers.contains(',') && !numbers.contains('\n') && !numbers.startsWith('//')) {
|
||||
return int.parse(numbers) + 1; // Off by one error
|
||||
return int.parse(numbers); // Fixed: Removed off-by-one error
|
||||
}
|
||||
|
||||
String delimiter = ',';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue