{"action":"created","issue":{"url":"https://api.github.com/repos/mamedev/mame/issues/503","labels_url":"https://api.github.com/repos/mamedev/mame/issues/503/labels{/name}","comments_url":"https://api.github.com/repos/mamedev/mame/issues/503/comments","events_url":"https://api.github.com/repos/mamedev/mame/issues/503/events","html_url":"https://github.com/mamedev/mame/pull/503","id":122361286,"number":503,"title":"Removed unneeded strlen in info.c","user":{"login":"MASHinfo","id":16196917,"avatar_url":"https://avatars.githubusercontent.com/u/16196917?v=3","gravatar_id":"","url":"https://api.github.com/users/MASHinfo","html_url":"https://github.com/MASHinfo","followers_url":"https://api.github.com/users/MASHinfo/followers","following_url":"https://api.github.com/users/MASHinfo/following{/other_user}","gists_url":"https://api.github.com/users/MASHinfo/gists{/gist_id}","starred_url":"https://api.github.com/users/MASHinfo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MASHinfo/subscriptions","organizations_url":"https://api.github.com/users/MASHinfo/orgs","repos_url":"https://api.github.com/users/MASHinfo/repos","events_url":"https://api.github.com/users/MASHinfo/events{/privacy}","received_events_url":"https://api.github.com/users/MASHinfo/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":9,"created_at":"2015-12-15T20:38:57Z","updated_at":"2015-12-16T05:41:17Z","closed_at":"2015-12-16T02:22:29Z","pull_request":{"url":"https://api.github.com/repos/mamedev/mame/pulls/503","html_url":"https://github.com/mamedev/mame/pull/503","diff_url":"https://github.com/mamedev/mame/pull/503.diff","patch_url":"https://github.com/mamedev/mame/pull/503.patch"},"body":"If \"device->shortname()!= nullptr\" then strlen of device->shortname() can not be 0.\r\nIncrease listxml output ==> 18%"},"comment":{"url":"https://api.github.com/repos/mamedev/mame/issues/comments/165001295","html_url":"https://github.com/mamedev/mame/pull/503#issuecomment-165001295","issue_url":"https://api.github.com/repos/mamedev/mame/issues/503","id":165001295,"user":{"login":"galibert","id":9249521,"avatar_url":"https://avatars.githubusercontent.com/u/9249521?v=3","gravatar_id":"","url":"https://api.github.com/users/galibert","html_url":"https://github.com/galibert","followers_url":"https://api.github.com/users/galibert/followers","following_url":"https://api.github.com/users/galibert/following{/other_user}","gists_url":"https://api.github.com/users/galibert/gists{/gist_id}","starred_url":"https://api.github.com/users/galibert/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/galibert/subscriptions","organizations_url":"https://api.github.com/users/galibert/orgs","repos_url":"https://api.github.com/users/galibert/repos","events_url":"https://api.github.com/users/galibert/events{/privacy}","received_events_url":"https://api.github.com/users/galibert/received_events","type":"User","site_admin":false},"created_at":"2015-12-16T05:41:17Z","updated_at":"2015-12-16T05:41:17Z","body":"And we want to accept empty but not null shortnames?\n\n  OG.\n\n\nOn Tue, Dec 15, 2015 at 10:39 PM, balr0g <notifications@github.com> wrote:\n\n> @MASHinfo <https://github.com/MASHinfo>'s intent seems to be to speed\n> things up, as strlen() is O(n) since it has to iterate over the string and\n> find the null terminator. Unfortunately, the returned string could exist\n> but be empty, in which case the code would print out tags like (with an\n> empty name entry), which we don't want.\n>\n> As an empty C string will have a null as its first character, it should be\n> faster (but less obvious) to do \"device->shortname()[0]=='\\0', and just as\n> safe as using strlen().\n>\n> @MASHinfo <https://github.com/MASHinfo>, can you test that, and see if it\n> also provides such a performance improvement?\n>\n> —\n> Reply to this email directly or view it on GitHub\n> <https://github.com/mamedev/mame/pull/503#issuecomment-164905352>.\n>\n"}}