Skip to content
This repository was archived by the owner on Nov 13, 2024. It is now read-only.

Commit 1287190

Browse files
committed
Refactor: 优化代码
1 parent 179baa3 commit 1287190

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/entity/commands/general/general_command.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export default class GeneralSendCommand extends InstanceCommand {
3434
if (!instance.process) instance.failure(new Error("命令执行失败,因为实例实际进程不存在."));
3535
// instance.process.write(buf);
3636
instance.process.write(encode(buf, instance.config.oe));
37-
if (instance.config.crlf === 1) instance.process.write("\n");
38-
if (instance.config.crlf === 2) instance.process.write("\r\n");
37+
if (instance.config.crlf === 2) return instance.process.write("\r\n");
38+
return instance.process.write("\n");
3939
}
4040
}

0 commit comments

Comments
 (0)