Remove the null check as per Axel's advice: valid arguments within the range

are never null.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@27450 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Ryan Leavengood 2008-09-12 13:44:00 +00:00
parent 90e8094e1e
commit c2a59f2305
1 changed files with 22 additions and 24 deletions

View File

@ -1218,32 +1218,30 @@ dump_thread_info(int argc, char **argv)
for (; argi < argc; argi++) {
const char *name = argv[argi];
if (name != NULL) {
int32 id = strtoul(name, NULL, 0);
int32 id = strtoul(name, NULL, 0);
if (IS_KERNEL_ADDRESS(id)) {
// semi-hack
_dump_thread_info((struct thread *)id, shortInfo);
continue;
}
// walk through the thread list, trying to match name or id
bool found = false;
struct hash_iterator i;
hash_open(sThreadHash, &i);
struct thread *thread;
while ((thread = (struct thread*)hash_next(sThreadHash, &i)) != NULL) {
if (!strcmp(name, thread->name) || thread->id == id) {
_dump_thread_info(thread, shortInfo);
found = true;
break;
}
}
hash_close(sThreadHash, &i, false);
if (!found)
kprintf("thread \"%s\" (%ld) doesn't exist!\n", name, id);
if (IS_KERNEL_ADDRESS(id)) {
// semi-hack
_dump_thread_info((struct thread *)id, shortInfo);
continue;
}
// walk through the thread list, trying to match name or id
bool found = false;
struct hash_iterator i;
hash_open(sThreadHash, &i);
struct thread *thread;
while ((thread = (struct thread*)hash_next(sThreadHash, &i)) != NULL) {
if (!strcmp(name, thread->name) || thread->id == id) {
_dump_thread_info(thread, shortInfo);
found = true;
break;
}
}
hash_close(sThreadHash, &i, false);
if (!found)
kprintf("thread \"%s\" (%ld) doesn't exist!\n", name, id);
}
return 0;