Skip to content

Commit

Permalink
Use LogicValue reversed
Browse files Browse the repository at this point in the history
  • Loading branch information
quekyj committed Nov 14, 2023
1 parent ca5faf4 commit c8ea171
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/src/binary_gray.dart
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class BinaryToGrayConverter extends Module {
///
/// Returns a list of [LogicValue] representing the Gray code.
List<LogicValue> binaryToGrayMap(LogicValue binary) {
final reverseBit = binary.toList().swizzle();
final reverseBit = binary.reversed;
final binList = reverseBit.toList().asMap().entries.map((entry) {
final currentBit = entry.value;
final idx = entry.key;
Expand Down Expand Up @@ -137,7 +137,7 @@ class GrayToBinaryConverter extends Module {
///
/// Returns a list of [LogicValue] representing the binary representation.
List<LogicValue> grayToBinaryMap(LogicValue gray) {
final reverseGray = gray.toList().swizzle();
final reverseGray = gray.reversed;
final grayList = reverseGray.toList();
var previousBit = LogicValue.zero;

Expand Down

0 comments on commit c8ea171

Please sign in to comment.