diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-04-03 17:30:03 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-04-03 17:30:03 +0200 |
commit | 46e92e1e568021ecdfa30bfea0efabe72b85633b (patch) | |
tree | eec82b604bfc0c2ec6784f83a54e5447beeb4082 | |
parent | a33d19eba8c614d113378ed07bbec0ce06227028 (diff) | |
download | busybox-w32-46e92e1e568021ecdfa30bfea0efabe72b85633b.tar.gz busybox-w32-46e92e1e568021ecdfa30bfea0efabe72b85633b.tar.bz2 busybox-w32-46e92e1e568021ecdfa30bfea0efabe72b85633b.zip |
ash: code shrink: do not take address of prefix(), allowing it to inline
function old new delta
getjob 281 285 +4
prefix 13 - -13
------------------------------------------------------------------------------
(add/remove: 0/1 grow/shrink: 1/0 up/down: 4/-13) Total: -9 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | shell/ash.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/shell/ash.c b/shell/ash.c index cb674e69c..d4ee4c93e 100644 --- a/shell/ash.c +++ b/shell/ash.c | |||
@@ -3962,7 +3962,6 @@ getjob(const char *name, int getctl) | |||
3962 | unsigned num; | 3962 | unsigned num; |
3963 | int c; | 3963 | int c; |
3964 | const char *p; | 3964 | const char *p; |
3965 | char *(*match)(const char *, const char *); | ||
3966 | 3965 | ||
3967 | jp = curjob; | 3966 | jp = curjob; |
3968 | p = name; | 3967 | p = name; |
@@ -4003,15 +4002,12 @@ getjob(const char *name, int getctl) | |||
4003 | } | 4002 | } |
4004 | } | 4003 | } |
4005 | 4004 | ||
4006 | match = prefix; | ||
4007 | if (*p == '?') { | ||
4008 | match = strstr; | ||
4009 | p++; | ||
4010 | } | ||
4011 | |||
4012 | found = NULL; | 4005 | found = NULL; |
4013 | while (jp) { | 4006 | while (jp) { |
4014 | if (match(jp->ps[0].ps_cmd, p)) { | 4007 | if (*p == '?' |
4008 | ? strstr(jp->ps[0].ps_cmd, p + 1) | ||
4009 | : prefix(jp->ps[0].ps_cmd, p) | ||
4010 | ) { | ||
4015 | if (found) | 4011 | if (found) |
4016 | goto err; | 4012 | goto err; |
4017 | found = jp; | 4013 | found = jp; |