Hey,
Not much, I aknowledge, just removes a useless "continue" and a useless "!".
IMO it improves (a little bit) readability.
I confess I would probably not do (or even not find) it if my IDE
wouldn't give me a hint to improve the code.
MM
Le 08/06/2018 à 11:16, edgar.sol...@web.de a écrit :
hey Mike,
can you give a rational for this change? it looks like a mere syntax change
without a runtime advantage. it still loops over all /layerables/.
..ede
On 08.06.2018 08:26, jump-pilot-svn--- via Jump-pilot-devel wrote:
Revision: 5860
http://sourceforge.net/p/jump-pilot/code/5860
Author: michaudm
Date: 2018-06-08 06:25:57 +0000 (Fri, 08 Jun 2018)
Log Message:
-----------
Simplify loops
Modified Paths:
--------------
core/trunk/src/com/vividsolutions/jump/workbench/model/LayerManager.java
Modified:
core/trunk/src/com/vividsolutions/jump/workbench/model/LayerManager.java
===================================================================
--- core/trunk/src/com/vividsolutions/jump/workbench/model/LayerManager.java
2018-06-08 06:00:39 UTC (rev 5859)
+++ core/trunk/src/com/vividsolutions/jump/workbench/model/LayerManager.java
2018-06-08 06:25:57 UTC (rev 5860)
@@ -541,16 +541,13 @@
for (Iterator<T> i = layerables.iterator(); i.hasNext();) {
T layerable = i.next();
- if (!(layerable instanceof Layer)) {
- continue;
+ if (layerable instanceof Layer) {
+ Layer layer = (Layer) layerable;
+ if (layer.isDrawingLast()) {
+ layersDrawnLast.add((T) layer);
+ i.remove();
+ }
}
-
- Layer layer = (Layer) layerable;
-
- if (layer.isDrawingLast()) {
- layersDrawnLast.add((T)layer);
- i.remove();
- }
}
layerables.addAll(layersDrawnLast);
@@ -690,10 +687,9 @@
for (Category category : categories) {
for (Layerable layerable : new ArrayList<>(category.getLayerables())) {
- if (!(layerableClass.isInstance(layerable))) {
- continue;
+ if (layerableClass.isInstance(layerable)) {
+ layers.add((T) layerable);
}
- layers.add((T)layerable);
}
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel