<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>tyamaguc07</author_name>
  <author_url>https://blog.hatena.ne.jp/tyamaguc07/</author_url>
  <blog_title>tyamaguc07's hatenablog</blog_title>
  <blog_url>https://tyamaguc07.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>list.toSet().size と list.distinct().size は同じ結果になる。 この違いは何であろうか？ 調べてみるとStack overflowに記事があった。 stackoverflow.com distinct() は内部的に toSet() しているとのことだ。 ほほーと思い実装を見に行った。 public fun &lt;T&gt; Iterable&lt;T&gt;.distinct(): List&lt;T&gt; { return this.toMutableSet().toList() } toSet() ではなく toMutableSet() ではあるが、確かにSetに変換することで重複…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ftyamaguc07.hatenablog.com%2Fentry%2F2024%2F12%2F27%2F013144&quot; title=&quot;kotlinの Iterable&amp;lt;T&amp;gt;.distinct() を眺めて気付いた、「実態としての可変」と「型としての不変」 - tyamaguc07&amp;#39;s hatenablog&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2024-12-27 01:31:44</published>
  <title>kotlinの Iterable&lt;T&gt;.distinct() を眺めて気付いた、「実態としての可変」と「型としての不変」</title>
  <type>rich</type>
  <url>https://tyamaguc07.hatenablog.com/entry/2024/12/27/013144</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
