refact: remove redundant escape (#9634)

* refact: remove redundant escape

Signed-off-by: fufesou <linlong1266@gmail.com>

* flutter, early assert

Signed-off-by: fufesou <linlong1266@gmail.com>

---------

Signed-off-by: fufesou <linlong1266@gmail.com>
This commit is contained in:
fufesou 2024-10-13 01:07:47 +08:00 committed by GitHub
parent eb1ef0969c
commit 65683cc3e6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 4 deletions

View File

@ -3616,3 +3616,7 @@ List<SubWindowResizeEdge>? get subWindowManagerEnableResizeEdges => isWindows
SubWindowResizeEdge.topRight,
]
: null;
void earlyAssert() {
assert('\1' == '1');
}

View File

@ -36,6 +36,7 @@ WindowType? kWindowType;
late List<String> kBootArgs;
Future<void> main(List<String> args) async {
earlyAssert();
WidgetsFlutterBinding.ensureInitialized();
debugPrint("launch args: $args");

View File

@ -155,9 +155,9 @@ class _RemotePageState extends State<RemotePage> {
var oldValue = _value;
_value = newValue;
var i = newValue.length - 1;
for (; i >= 0 && newValue[i] != '\1'; --i) {}
for (; i >= 0 && newValue[i] != '1'; --i) {}
var j = oldValue.length - 1;
for (; j >= 0 && oldValue[j] != '\1'; --j) {}
for (; j >= 0 && oldValue[j] != '1'; --j) {}
if (i < j) j = i;
var subNewValue = newValue.substring(j + 1);
var subOldValue = oldValue.substring(j + 1);
@ -206,8 +206,8 @@ class _RemotePageState extends State<RemotePage> {
_value = newValue;
if (oldValue.isNotEmpty &&
newValue.isNotEmpty &&
oldValue[0] == '\1' &&
newValue[0] != '\1') {
oldValue[0] == '1' &&
newValue[0] != '1') {
// clipboard
oldValue = '';
}