Skip to content

Commit 3e89893

Browse files
committed
revert useless sorter change
1 parent 9e0aea7 commit 3e89893

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

pkgs/ffigen/lib/src/visitor/sorter.dart

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,12 @@ class SorterVisitation extends Visitation {
2222
// all other types.
2323
static String originalNameSortKey(Binding binding) =>
2424
'${_typeKey(binding)} ${binding.originalName}';
25-
// '~' comes after all valid Dart naming characters.
26-
static const _lowPriorityTypes = {
27-
'ObjCCategory': '~ObjCCategory',
28-
'ObjCProtocol': '~ObjCProtocol',
29-
'ObjCMethod': '~~ObjCMethod',
30-
};
25+
static const _lowPriorityTypes = {'ObjCCategory', 'ObjCProtocol'};
3126
static String _typeKey(Object o) {
3227
final t = '${o.runtimeType}';
33-
return _lowPriorityTypes[t] ?? t;
28+
// '~' comes after all valid Dart naming characters.
29+
if (_lowPriorityTypes.contains(t)) return '~$t';
30+
return t;
3431
}
3532

3633
@override

0 commit comments

Comments
 (0)