{"id":159,"date":"2006-11-17T14:26:19","date_gmt":"2006-11-17T12:26:19","guid":{"rendered":"http:\/\/soci.hu\/blog\/index.php\/2006\/11\/17\/arg_bogusicomparer\/"},"modified":"2006-11-17T14:27:16","modified_gmt":"2006-11-17T12:27:16","slug":"arg_bogusicomparer","status":"publish","type":"post","link":"https:\/\/soci.hu\/blog\/index.php\/2006\/11\/17\/arg_bogusicomparer\/","title":{"rendered":"Arg_BogusIComparer"},"content":{"rendered":"<p>Ezt a resource-\u00f6t az mscorlibben tal\u00e1lhatj\u00e1tok meg, \u00e9s az olyan l\u00e1m\u00e1knak rakt\u00e1k bele, mint \u00e9n:<\/p>\n<p>Arg_BogusIComparer=IComparer (or the IComparable methods it relies upon) did not return zero when Array.Sort called x. CompareTo(x). x: &#8216;{0}&#8217;  x&#8217;s type: &#8216;{1}&#8217; The IComparer: &#8216;{2}&#8217;.<\/p>\n<p>Egy intelligens(nek tervezett) kollekci\u00f3ban \u00edrtam saj\u00e1t IComparert, \u00e1m elfeledkeztem arr\u00f3l az esetr\u0151l, amikor mindk\u00e9t \u00f6sszehasonl\u00edtand\u00f3 elem null. Erre false v\u00e1laszt adtam, ett\u0151l beh\u00fcly\u00fclt az Array.Sort, de szerencs\u00e9re felk\u00e9sz\u00fcltek az olyan majmokra, mint \u00e9n, \u00e9s nem egyszer\u0171en t\u00falc\u00edmezt\u00e9k a t\u00f6mb\u00f6t, hanem sz\u00f3ltak, hogy koll\u00e9ga, bugos a Comparer.<\/p>\n<p>Tanuls\u00e1g: tess\u00e9k lekezelni minden lehets\u00e9ges esetet a Comparerben, a rossz bemeneti t\u00edpusokat \u00e9s a nullokat is. Ha persze lehet, haszn\u00e1ljatok IComprer-t, akkor nem m\u00e1r csak a nullokkal kell k\u00fcl\u00f6n foglalkozni.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ezt a resource-\u00f6t az mscorlibben tal\u00e1lhatj\u00e1tok meg, \u00e9s az olyan l\u00e1m\u00e1knak rakt\u00e1k bele, mint \u00e9n: Arg_BogusIComparer=IComparer (or the IComparable methods it relies&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,4],"tags":[],"class_list":["post-159","post","type-post","status-publish","format-standard","hentry","category-net","category-szakmai-elet"],"_links":{"self":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=159"}],"version-history":[{"count":0,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/posts\/159\/revisions"}],"wp:attachment":[{"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/soci.hu\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}