nextStreamId method

int? nextStreamId(
  1. Map<int, dynamic> streamIds
)

Implementation

int? nextStreamId(Map<int, dynamic> streamIds) {
  var nextStreamId;
  do {
    streamId += 2;
    //Dart int range -2**53 to 2**53
    if (streamId > StreamIdSupplier.MASK) {
      streamId = initialValue + 2;
    }
    nextStreamId = streamId;
  } while (nextStreamId == 0 || streamIds.containsKey(nextStreamId));
  return nextStreamId;
}