[riot-notifications] [RIOT] shell: refactor default shell command handling (#300)

LudwigOrtmann notifications at github.com
Wed Nov 13 19:23:25 CET 2013


> -    entry = _shell_command_list;
> -
> -    while (entry->name != NULL) {
> -        if (strcmp(entry->name, command) == 0) {
> -            return entry->handler;
> -        }
> -        else {
> -            entry++;
> +        _shell_command_list,
> +#endif
> +    };
> +
> +    const shell_command_t *entry;
> +
> +    for (int i = 0; i < sizeof(command_lists)/sizeof(entry); i++) {
> +        if ((entry = command_lists[i])) {

Would you mind adding ' != NULL` here and below to make it clearer?

---
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/300/files#r7635105
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20131113/9159cf65/attachment.html>


More information about the notifications mailing list