diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-28 10:38:44 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2021-01-28 10:38:44 (GMT) |
commit | 9c024d9d3bfcd6cee7c0a39492f7e1fd4f80192d (patch) | |
tree | c00f1e2c3c0c427dc5fce5b4dd4b760c77d70fbc /library/opt | |
parent | 6b29884385ff5fa383bd25b84ae1184db4f8811c (diff) | |
download | tcl-9c024d9d3bfcd6cee7c0a39492f7e1fd4f80192d.zip tcl-9c024d9d3bfcd6cee7c0a39492f7e1fd4f80192d.tar.gz tcl-9c024d9d3bfcd6cee7c0a39492f7e1fd4f80192d.tar.bz2 |
Use "in" operator in stead of "lsearch -exact" when possible
Diffstat (limited to 'library/opt')
-rw-r--r-- | library/opt/optparse.tcl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/library/opt/optparse.tcl b/library/opt/optparse.tcl index 1639379..454b923 100644 --- a/library/opt/optparse.tcl +++ b/library/opt/optparse.tcl @@ -601,7 +601,7 @@ proc ::tcl::OptCheckType {arg type {typeArgs ""}} { return [expr {$arg ? 1 : 0}] } choice { - if {[lsearch -exact $typeArgs $arg] < 0} { + if {$arg ni $typeArgs} { error "invalid choice" } return $arg |