-
Notifications
You must be signed in to change notification settings - Fork 29
Expand file tree
/
Copy pathfix.diff
More file actions
26 lines (25 loc) · 844 Bytes
/
fix.diff
File metadata and controls
26 lines (25 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<<<<<<< SEARCH
// Helper method to parse rating
bool _hasRatingValue(String? r) {
if (r == null) return false;
final t = r.trim();
if (t.isEmpty || t == 'N/A') return false;
final m = RegExp(r'([0-9]+(?:\.[0-9]+)?)').firstMatch(t);
if (m == null) return false;
final v = double.tryParse(m.group(1)!);
return v != null && v > 0;
}
=======
// Helper method to parse rating
// Using a static final RegExp to avoid recompiling the pattern on every call, improving performance.
final RegExp _ratingRegExp = RegExp(r'([0-9]+(?:\.[0-9]+)?)');
bool _hasRatingValue(String? r) {
if (r == null) return false;
final t = r.trim();
if (t.isEmpty || t == 'N/A') return false;
final m = _ratingRegExp.firstMatch(t);
if (m == null) return false;
final v = double.tryParse(m.group(1)!);
return v != null && v > 0;
}
>>>>>>> REPLACE