Dont call tcgetattr when no operations are specified

This commit is contained in:
Kovid Goyal
2023-09-22 09:37:48 +05:30
parent fe4fdaefb9
commit fc1331cfdc

View File

@@ -179,6 +179,9 @@ func (self *Term) set_termios_attrs(when uintptr, modify func(*unix.Termios)) (e
}
func (self *Term) ApplyOperations(when uintptr, operations ...TermiosOperation) (err error) {
if len(operations) == 0 {
return
}
return self.set_termios_attrs(when, func(t *unix.Termios) {
for _, op := range operations {
op(t)