<div dir="ltr"><div class="gmail_default" style="font-family:georgia,serif">I managed to do that by using `map` as I didn't find the equivalence.</div><div class="gmail_default" style="font-family:georgia,serif"><br></div><div class="gmail_default"><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal;color:rgb(61,29,129)"><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">files</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)">.</span><span style="font-variant-ligatures:no-common-ligatures">forEach</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,0,0)"> {</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">var</span><span style="font-variant-ligatures:no-common-ligatures"> indices = </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">IndexSet</span><span style="font-variant-ligatures:no-common-ligatures">()</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"> </span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">for</span><span style="font-variant-ligatures:no-common-ligatures"> index </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">in</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(39,42,216)">0</span><span style="font-variant-ligatures:no-common-ligatures"> ..< </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">subtitleFiles</span><span style="font-variant-ligatures:no-common-ligatures">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(112,61,170)">count</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">if</span><span style="font-variant-ligatures:no-common-ligatures"> $0.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">sn</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">==</span><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">subtitleFiles</span><span style="font-variant-ligatures:no-common-ligatures">[index].</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">sn</span><span style="font-variant-ligatures:no-common-ligatures"> {</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> indices.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">insert</span><span style="font-variant-ligatures:no-common-ligatures">(index)</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> }</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal;min-height:13px"><span style="font-variant-ligatures:no-common-ligatures"> </span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">let</span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures"> subtitles = indices.</span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">map</span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures"> { </span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures;color:rgb(187,44,162)">return</span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures"> </span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">subtitleFiles</span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures">[$0] } </span><span style="font-family:menlo;font-variant-ligatures:no-common-ligatures;color:rgb(0,132,0)">// get array at IndexSet</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">videoSubtitles</span><span style="font-variant-ligatures:no-common-ligatures">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">updateValue</span><span style="font-variant-ligatures:no-common-ligatures">(subtitles, forKey: $0)</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"> indices.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">reversed</span><span style="font-variant-ligatures:no-common-ligatures">().</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">forEach</span><span style="font-variant-ligatures:no-common-ligatures"> { </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(79,129,135)">subtitleFiles</span><span style="font-variant-ligatures:no-common-ligatures">.</span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(61,29,129)">remove</span><span style="font-variant-ligatures:no-common-ligatures">(at: $0) } </span><span style="font-variant-ligatures:no-common-ligatures;color:rgb(0,132,0)">// remove elements at IndexSet</span></p>
<p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures">}</span></p><p style="font-family:menlo;margin:0px;font-size:11px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><br></span></p><p style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="georgia, serif">Is there a better way to do that?</font></span></p><p style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="georgia, serif"><br></font></span></p><p style="margin:0px;line-height:normal"><span style="font-variant-ligatures:no-common-ligatures"><font face="georgia, serif">Zhaoxin</font></span></p></div></div>