cmdline: minor optimizaztion
parent
fb54a2635c
commit
ec9566988a
|
@ -39,11 +39,9 @@ pub fn option(args []string, param string, def string) string {
|
||||||
// what: ['test']
|
// what: ['test']
|
||||||
// ret: ['-stat']
|
// ret: ['-stat']
|
||||||
pub fn options_before(args []string, what []string) []string {
|
pub fn options_before(args []string, what []string) []string {
|
||||||
mut found := false
|
|
||||||
mut args_before := []string
|
mut args_before := []string
|
||||||
for a in args {
|
for a in args {
|
||||||
if a in what {
|
if a in what {
|
||||||
found = true
|
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
args_before << a
|
args_before << a
|
||||||
|
|
Loading…
Reference in New Issue