entriesToDoubles static method
Implementation
static List<double> entriesToDoubles(List<Float64x2> list) {
final lastEntryIndex = list.length - 1;
var entryIndex = 0;
var entry = list.first;
var entryCursor = -1;
var valueCursor = -1;
var fs = List.generate(list.length * 2, (i) {
assert(++valueCursor == i);
switch (++entryCursor) {
case 0:
{
return entry.x;
}
case 1:
{
var y = entry.y;
if (entryIndex < lastEntryIndex) {
entry = list[++entryIndex];
entryCursor = -1;
}
return y;
}
default:
throw StateError('Invalid entryCursor: $entryCursor');
}
});
return fs;
}