Skip to content

Commit d83e351

Browse files
authored
Nutze Math.min() statt eigener Logik (#86)
1 parent 7d789b9 commit d83e351

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

src/de/willuhn/jameica/hbci/gui/parts/SparQuote.java

+1-4
Original file line numberDiff line numberDiff line change
@@ -433,10 +433,7 @@ private boolean load() throws RemoteException
433433
cal.add(Calendar.MONTH,monate);
434434

435435
// Der Tag, ab dem die naechste Periode beginnt
436-
if (stichtag > cal.getActualMaximum(Calendar.DAY_OF_MONTH))
437-
cal.set(Calendar.DATE,cal.getActualMaximum(Calendar.DAY_OF_MONTH));
438-
else
439-
cal.set(Calendar.DATE, stichtag);
436+
cal.set(Calendar.DATE, Math.min(stichtag, cal.getActualMaximum(Calendar.DAY_OF_MONTH)));
440437

441438
// Merken wir uns fuer den naechsten Durchlauf
442439
from = DateUtil.startOfDay(cal.getTime());

src/de/willuhn/jameica/hbci/passports/pintan/PhotoTANDialog.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ protected void paint(Composite parent) throws Exception
178178
int width = resize + 100;
179179
final int displayHeight = GUI.getDisplay().getBounds().height;
180180
Point p = this.getShell().computeSize(width,SWT.DEFAULT);
181-
int height = p.y >= displayHeight ? displayHeight : p.y;
181+
int height = Math.min(p.y, displayHeight);
182182
this.setSize(width,height);
183183
}
184184

0 commit comments

Comments
 (0)