Skip to content

Commit 61cde33

Browse files
committed
Feedback
1 parent 64e7ef6 commit 61cde33

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

pkgs/crypto/lib/src/hash_sink.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -93,23 +93,23 @@ abstract class HashSink implements Sink<List<int>> {
9393
}
9494

9595
void _addData(List<int> data) {
96-
var dataIdx = 0;
96+
var dataIndex = 0;
9797
var chunkNextIndex = _chunkNextIndex;
9898
final size = _chunk.length;
9999
_byteDataView ??= _chunk.buffer.asByteData();
100100
while (true) {
101-
// Is there enough data left in [data] for a full chunk?
102-
var restEnd = chunkNextIndex + data.length - dataIdx;
101+
// Check if there is enough data left in [data] for a full chunk.
102+
var restEnd = chunkNextIndex + data.length - dataIndex;
103103
if (restEnd < size) {
104-
// No. Just add into [_chunk].
105-
_chunk.setRange(chunkNextIndex, restEnd, data, dataIdx);
104+
// There is not enough data, so just add into [_chunk].
105+
_chunk.setRange(chunkNextIndex, restEnd, data, dataIndex);
106106
_chunkNextIndex = restEnd;
107107
return;
108108
}
109109

110-
// Yes. Fill out [_chunk] and process it.
111-
_chunk.setRange(chunkNextIndex, size, data, dataIdx);
112-
dataIdx += size - chunkNextIndex;
110+
// There is enough data to fill the chunk. Fill it and process it.
111+
_chunk.setRange(chunkNextIndex, size, data, dataIndex);
112+
dataIndex += size - chunkNextIndex;
113113

114114
// Now do endian conversion to words.
115115
var j = 0;
File renamed without changes.

0 commit comments

Comments
 (0)