Re: [EGIT PATCH 7/9] Add a job to refresh projects when the index changes.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote:
> +
> +	static class RIRefresh extends Job implements RepositoryListener {
...
> +			while (projectsToScan.size() > 0) {
> +				IProject p;
> +				synchronized (projectsToScan) {
> +					if (projectsToScan.size() == 0) {
> +					}
> +					p = projectsToScan.iterator().next();

This is going to throw some sort of no such element exception when
you call next when projectsToScan is empty.  You are missing a
break inside of the if test that is meant to guard against this.

> +					projectsToScan.remove(p);
> +				}

You have gone to the trouble of allocating the Iterator to obtain
the next item, you should also just use it to do the deletion of
the next item.  Its quicker to let the Iterator do the remove as
it already has the pointer to the proper element position.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux