Skip to content

Commit c385cbc

Browse files
committed
Check for existence of packs and messages before checking if they should be shown
Doing these cheaper checks against null first gives better short circuiting behavior, avoiding the more expensive calls to check if they should be shown when they don't exist.
1 parent 327b6d9 commit c385cbc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/projections/Tools/Timeline/EntryMethodObject.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -911,7 +911,7 @@ public boolean paintMe(Graphics2D g2d, final int actualDisplayWidth, final int t
911911
912912
*/
913913

914-
if(data.showPacks() && packs != null)
914+
if(packs != null && data.showPacks())
915915
{
916916
g2d.setColor(Color.pink);
917917
for(PackTime pt : packs){
@@ -938,7 +938,7 @@ public boolean paintMe(Graphics2D g2d, final int actualDisplayWidth, final int t
938938

939939
// Show the message sends. See note above for the message packing areas
940940
// Don't change this without changing MainPanel's paintComponent which draws message send lines
941-
if(data.showMsgs() == true && messages != null)
941+
if(messages != null && data.showMsgs())
942942
{
943943
g2d.setColor(data.getForegroundColor());
944944

0 commit comments

Comments
 (0)