Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
LatinIME
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
keyboard
LatinIME
Commits
69100329
Commit
69100329
authored
11 years ago
by
Jean Chalard
Committed by
Android (Google) Code Review
11 years ago
Browse files
Options
Downloads
Plain Diff
Merge "Use an iterator to remove stuff from an ArrayList."
parents
f6a1a765
0dc422e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
java/src/com/android/inputmethod/latin/DictionaryInfoUtils.java
+7
-4
7 additions, 4 deletions
...rc/com/android/inputmethod/latin/DictionaryInfoUtils.java
with
7 additions
and
4 deletions
java/src/com/android/inputmethod/latin/DictionaryInfoUtils.java
+
7
−
4
View file @
69100329
...
...
@@ -30,6 +30,7 @@ import com.android.inputmethod.latin.makedict.UnsupportedFormatException;
import
java.io.File
;
import
java.io.IOException
;
import
java.util.ArrayList
;
import
java.util.Iterator
;
import
java.util.Locale
;
/**
...
...
@@ -301,12 +302,14 @@ public class DictionaryInfoUtils {
private
static
void
addOrUpdateDictInfo
(
final
ArrayList
<
DictionaryInfo
>
dictList
,
final
DictionaryInfo
newElement
)
{
for
(
final
DictionaryInfo
info
:
dictList
)
{
if
(
info
.
mLocale
.
equals
(
newElement
.
mLocale
))
{
if
(
newElement
.
mVersion
<=
info
.
mVersion
)
{
final
Iterator
<
DictionaryInfo
>
iter
=
dictList
.
iterator
();
while
(
iter
.
hasNext
())
{
final
DictionaryInfo
thisDictInfo
=
iter
.
next
();
if
(
thisDictInfo
.
mLocale
.
equals
(
newElement
.
mLocale
))
{
if
(
newElement
.
mVersion
<=
thisDictInfo
.
mVersion
)
{
return
;
}
dictList
.
remove
(
info
);
iter
.
remove
();
}
}
dictList
.
add
(
newElement
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment