Keep nativeIDs immutable in ReactFindViewUtil

Reviewed By: mdvacca

Differential Revision: D7430144

fbshipit-source-id: c8e8242c1c3216258e4b8c27623160338e2578d8
This commit is contained in:
Ram N 2018-03-29 16:05:10 -07:00 коммит произвёл Facebook Github Bot
Родитель 9bdc31069a
Коммит ee0c69dfa6
1 изменённых файлов: 5 добавлений и 13 удалений

Просмотреть файл

@ -129,19 +129,11 @@ public class ReactFindViewUtil {
}
}
Iterator<Map.Entry<OnMultipleViewsFoundListener, Set<String>>>
viewIterator = mOnMultipleViewsFoundListener.entrySet().iterator();
while (viewIterator.hasNext()) {
Map.Entry<OnMultipleViewsFoundListener, Set<String>> entry =
viewIterator.next();
Set<String> nativeIds = entry.getValue();
if (nativeIds.contains(nativeId)) {
entry.getKey().onViewFound(view, nativeId);
nativeIds.remove(nativeId); // remove it from list of NativeIds to search for.
}
if (nativeIds.isEmpty()) {
viewIterator.remove();
}
for (Map.Entry<OnMultipleViewsFoundListener, Set<String>> entry : mOnMultipleViewsFoundListener.entrySet()) {
Set<String> nativeIds = entry.getValue();
if (nativeIds != null && nativeIds.contains(nativeId)) {
entry.getKey().onViewFound(view, nativeId);
}
}
}