{"id":37824,"date":"2022-12-05T16:01:40","date_gmt":"2022-12-05T21:01:40","guid":{"rendered":"https:\/\/mjtsai.com\/blog\/?p=37824"},"modified":"2022-12-05T16:01:40","modified_gmt":"2022-12-05T21:01:40","slug":"swift-set-intersection-bug","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2022\/12\/05\/swift-set-intersection-bug\/","title":{"rendered":"Swift Set Intersection Bug"},"content":{"rendered":"<p><a href=\"https:\/\/davedelong.com\/blog\/2022\/12\/03\/adventures-in-advent-of-code\/\">Dave DeLong<\/a>:<\/p>\n<blockquote cite=\"https:\/\/davedelong.com\/blog\/2022\/12\/03\/adventures-in-advent-of-code\/\"><p>It turns out, there <em>was<\/em> a bug in <code>Set.intersection(_:)<\/code>, but it had only been discovered this past June, and the fix only applies to macOS Ventura and later (my machine is running Monterey still). The scope of the bug is fairly limited: it only showed up if you were using the general intersection method, and the sequence had &ldquo;exactly as many duplicate items as items missing from <code>self<\/code>&rdquo;. As it turned out, Advent of Code happened to provide me with exactly the right input to hit this multiple times.<\/p><\/blockquote>","protected":false},"excerpt":{"rendered":"<p>Dave DeLong: It turns out, there was a bug in Set.intersection(_:), but it had only been discovered this past June, and the fix only applies to macOS Ventura and later (my machine is running Monterey still). The scope of the bug is fairly limited: it only showed up if you were using the general intersection [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"2022-12-05T21:01:42Z","apple_news_api_id":"a8f02a39-b729-454c-8c83-ad45626a4cbb","apple_news_api_modified_at":"2022-12-05T21:01:42Z","apple_news_api_revision":"AAAAAAAAAAD\/\/\/\/\/\/\/\/\/\/w==","apple_news_api_share_url":"https:\/\/apple.news\/AqPAqObcpRUyMg61FYmpMuw","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[131,30,2077,2223,71,901],"class_list":["post-37824","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-bug","tag-mac","tag-macos-12","tag-macos-13-ventura","tag-programming","tag-swift-programming-language"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/37824","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=37824"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/37824\/revisions"}],"predecessor-version":[{"id":37825,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/37824\/revisions\/37825"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=37824"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=37824"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=37824"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}