Yes, you are correct.
In fact, I've thought about this. The original code was:
1196 boolean found = false;
1197 for (int i = 0; i < records.length; i++) {
1198 if (records[i].equals(mapRealm)) {
1199 found = true;
1200 realm = records[i];
1201 }
1202 }
and I asked myself: should I also loop thru all elements?
I'll add a break. This is not a good coding style.
Thanks
Max
On 07/17/2010 04:28 PM, Alan Bateman wrote:
Valerie (Yu-Ching) Peng wrote:
Looks fine except the following minor nit:
- Why not return realm on line 1224 after a match is found? Doesn't
seem necessary to continue w/ the whole for-loop.
Indeed, looks like it is missing a "break".
-Alan.