{"action":"created","issue":{"url":"https://api.github.com/repos/manastech/crystal/issues/1452","labels_url":"https://api.github.com/repos/manastech/crystal/issues/1452/labels{/name}","comments_url":"https://api.github.com/repos/manastech/crystal/issues/1452/comments","events_url":"https://api.github.com/repos/manastech/crystal/issues/1452/events","html_url":"https://github.com/manastech/crystal/pull/1452","id":106133630,"number":1452,"title":"Allow comparison between different Iterable types.","user":{"login":"technorama","id":51043,"avatar_url":"https://avatars.githubusercontent.com/u/51043?v=3","gravatar_id":"","url":"https://api.github.com/users/technorama","html_url":"https://github.com/technorama","followers_url":"https://api.github.com/users/technorama/followers","following_url":"https://api.github.com/users/technorama/following{/other_user}","gists_url":"https://api.github.com/users/technorama/gists{/gist_id}","starred_url":"https://api.github.com/users/technorama/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/technorama/subscriptions","organizations_url":"https://api.github.com/users/technorama/orgs","repos_url":"https://api.github.com/users/technorama/repos","events_url":"https://api.github.com/users/technorama/events{/privacy}","received_events_url":"https://api.github.com/users/technorama/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":15,"created_at":"2015-09-12T05:41:58Z","updated_at":"2015-09-14T13:32:30Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/manastech/crystal/pulls/1452","html_url":"https://github.com/manastech/crystal/pull/1452","diff_url":"https://github.com/manastech/crystal/pull/1452.diff","patch_url":"https://github.com/manastech/crystal/pull/1452.patch"},"body":"Fixed incorrect array comparison results.\r\nFixed Enumerable spec.\r\nAdded Iterable spec.\r\nStaticArray is now Iterable.\r\n== and equals? moved from Array to Iterable"},"comment":{"url":"https://api.github.com/repos/manastech/crystal/issues/comments/140076859","html_url":"https://github.com/manastech/crystal/pull/1452#issuecomment-140076859","issue_url":"https://api.github.com/repos/manastech/crystal/issues/1452","id":140076859,"user":{"login":"waj","id":22697,"avatar_url":"https://avatars.githubusercontent.com/u/22697?v=3","gravatar_id":"","url":"https://api.github.com/users/waj","html_url":"https://github.com/waj","followers_url":"https://api.github.com/users/waj/followers","following_url":"https://api.github.com/users/waj/following{/other_user}","gists_url":"https://api.github.com/users/waj/gists{/gist_id}","starred_url":"https://api.github.com/users/waj/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/waj/subscriptions","organizations_url":"https://api.github.com/users/waj/orgs","repos_url":"https://api.github.com/users/waj/repos","events_url":"https://api.github.com/users/waj/events{/privacy}","received_events_url":"https://api.github.com/users/waj/received_events","type":"User","site_admin":false},"created_at":"2015-09-14T13:32:30Z","updated_at":"2015-09-14T13:32:30Z","body":"It could be slower because using iterators sometimes introduce a small overhead, althought it might not be the case here. On the other hand, if the two arrays have different size there is no need to compare every element until it reaches the end of one of them. \r\n\r\nI think the condition to figure out if memcmp can be used or not depends on if the default comparison has been redefined. For example you can define a struct type with only value types as members, but still make different instances with different values, equal under the comparison. "}}