Skip to content

Commit

Permalink
Split SassNumber into separate subclasses based on units (#1221)
Browse files Browse the repository at this point in the history
This allows us to use more efficient implementations in the common
case where numbers don't have complex units.

See #113
  • Loading branch information
nex3 committed Feb 3, 2021
1 parent e664ea8 commit 2682992
Show file tree
Hide file tree
Showing 7 changed files with 429 additions and 136 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 1.32.7

* Improve the performance of unitless and single-unit numbers.

## 1.32.6

### Node JS API
Expand Down
4 changes: 2 additions & 2 deletions lib/src/value/external/number.dart
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ abstract class SassNumber extends Value {

/// Creates a number with full [numeratorUnits] and [denominatorUnits].
factory SassNumber.withUnits(num value,
{Iterable<String> numeratorUnits,
Iterable<String> denominatorUnits}) = internal.SassNumber.withUnits;
{List<String> numeratorUnits,
List<String> denominatorUnits}) = internal.SassNumber.withUnits;

/// Returns [value] as an [int], if it's an integer value according to
/// [isInt].
Expand Down
Loading

0 comments on commit 2682992

Please sign in to comment.