Author: nextgens
Date: 2009-04-16 22:38:46 +0000 (Thu, 16 Apr 2009)
New Revision: 26910

Modified:
   branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java
Log:
minor optimization

Modified: branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java
===================================================================
--- branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java       
2009-04-16 22:35:10 UTC (rev 26909)
+++ branches/nextgens-stuffs/freenet/src/freenet/io/comm/MessageCore.java       
2009-04-16 22:38:46 UTC (rev 26910)
@@ -159,10 +159,12 @@
                        
((PeerNode)m.getSource()).addToLocalNodeReceivedMessagesFromStatistic(m);
                }
                boolean matched = false;
+               if(logMINOR) {
                if (!(m.getSpec().equals(DMT.packetTransmit))) {
-                       if(logMINOR) Logger.minor(this, "" + 
(System.currentTimeMillis() % 60000) + ' ' + from + " <- "
+                       Logger.minor(this, "" + (System.currentTimeMillis() % 
60000) + ' ' + from + " <- "
                                        + m.getSource() + " : " + m);
                }
+               }
                MessageFilter match = null;
                synchronized (_filters) {
                        for (ListIterator<MessageFilter> i = 
_filters.listIterator(); i.hasNext();) {
@@ -250,11 +252,12 @@
                        }
                }
                long tEnd = System.currentTimeMillis();
-               if(tEnd - tStart > 50) {
-                       if(tEnd - tStart > 3000)
-                               Logger.error(this, "checkFilters took 
"+(tEnd-tStart)+"ms with unclaimedFIFOSize of "+_unclaimed.size()+" for 
matched: "+matched);
+               long dT = tEnd - tStart; 
+               if(dT > 50) {
+                       if(dT > 3000)
+                               Logger.error(this, "checkFilters took 
"+(dT)+"ms with unclaimedFIFOSize of "+_unclaimed.size()+" for matched: 
"+matched);
                        else
-                               if(logMINOR) Logger.minor(this, "checkFilters 
took "+(tEnd-tStart)+"ms with unclaimedFIFOSize of "+_unclaimed.size()+" for 
matched: "+matched);
+                               if(logMINOR) Logger.minor(this, "checkFilters 
took "+(dT)+"ms with unclaimedFIFOSize of "+_unclaimed.size()+" for matched: 
"+matched);
                }
        }
        

_______________________________________________
cvs mailing list
[email protected]
http://emu.freenetproject.org/cgi-bin/mailman/listinfo/cvs

Reply via email to