Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary parameter and dead code #4328

Merged
merged 2 commits into from
Mar 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 3 additions & 18 deletions librz/util/sdb/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,27 +181,12 @@ static int sdb_dump(const char *db, int fmt) {
return sdb_grep_dump(db, fmt, false, NULL);
}

static int insertkeys(Sdb *s, const char **args, int nargs, int mode) {
static int insertkeys(Sdb *s, const char **args, int nargs) {
int must_save = 0;
if (args && nargs > 0) {
int i;
for (i = 0; i < nargs; i++) {
switch (mode) {
case '-':
must_save |= sdb_query(s, args[i]);
break;
case '=':
if (strchr(args[i], '=')) {
char *v, *kv = (char *)strdup(args[i]);
v = strchr(kv, '=');
if (v) {
*v++ = 0;
sdb_disk_insert(s, kv, v);
}
free(kv);
}
break;
}
must_save |= sdb_query(s, args[i]);
}
}
return must_save;
Expand Down Expand Up @@ -415,7 +400,7 @@ int main(int argc, const char **argv) {
sdb_config(s, options);
int kvs = db0 + 2;
if (kvs < argc) {
save |= insertkeys(s, argv + argi + 2, argc - kvs, '-');
save |= insertkeys(s, argv + argi + 2, argc - kvs);
}
for (; (line = slurp(stdin, NULL));) {
save |= sdb_query(s, line);
Expand Down
Loading