Skip to content

Commit

Permalink
internal_link [nfc]: Narrow a type a little bit
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisbobbe committed May 15, 2024
1 parent 5e0b964 commit 122ac4b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/model/internal_link.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import 'package:json_annotation/json_annotation.dart';
import '../api/model/narrow.dart';
import 'narrow.dart';
import 'store.dart';
import 'stream.dart';

part 'internal_link.g.dart';

Expand Down Expand Up @@ -238,7 +239,7 @@ enum _NarrowOperator {
///
/// Returns null if the operand has an unexpected shape, or has the old shape
/// (stream name but no ID) and we don't know of a stream by the given name.
int? _parseStreamOperand(String operand, PerAccountStore store) {
int? _parseStreamOperand(String operand, StreamStore store) {
// "New" (2018) format: ${stream_id}-${stream_name} .
final match = RegExp(r'^(\d+)(?:-.*)?$').firstMatch(operand);
final newFormatStreamId = (match != null) ? int.parse(match.group(1)!, radix: 10) : null;
Expand Down

0 comments on commit 122ac4b

Please sign in to comment.