Skip to content

Commit

Permalink
fixup! refactor: rework option system
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Aug 14, 2022
1 parent d9fa3f1 commit 2fa46f0
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/src/option/integer_option.dart
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,6 @@ abstract class IntegerOption extends Option<int> {
static bool _needsLeadingByteRemoval(final Uint8Buffer buffer) =>
_secondLastElementIsZeroOrEmpty(buffer) && _lastElementIsZero(buffer);

/// Returns the second last element of a [buffer].
///
/// Throws a [StateError] if the index is out of range.
static int _secondLastElement(final Uint8Buffer buffer) =>
buffer.elementAt(buffer.length - 2);

/// Indicates if the last element of a [buffer] is zero.
///
/// Returns `false` if this [Uint8Buffer] is empty.
Expand All @@ -103,7 +97,7 @@ abstract class IntegerOption extends Option<int> {
return true;
}

return _secondLastElement(buffer) == 0;
return buffer.elementAt(buffer.length - 2) == 0;
}

@override
Expand Down

0 comments on commit 2fa46f0

Please sign in to comment.