IDEMPIERE-4800 Performance - avoid multiple for in GridTab.getParentTabNo (#699)
This commit is contained in:
parent
17a80a0beb
commit
6d78119006
|
@ -112,7 +112,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private static final long serialVersionUID = 5086068543834849233L;
|
private static final long serialVersionUID = 6119615577891555600L;
|
||||||
|
|
||||||
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
|
public static final String DEFAULT_STATUS_MESSAGE = "NavigateOrUpdate";
|
||||||
|
|
||||||
|
@ -2854,6 +2854,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
|
|
||||||
private boolean m_updateWindowContext = true;
|
private boolean m_updateWindowContext = true;
|
||||||
|
|
||||||
|
// Cached parent Tab No
|
||||||
|
private int m_parentTabNo = -1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return list of active call out for this tab
|
* @return list of active call out for this tab
|
||||||
|
@ -3323,11 +3326,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
*/
|
*/
|
||||||
private int getParentTabNo()
|
private int getParentTabNo()
|
||||||
{
|
{
|
||||||
|
if (m_parentTabNo >= 0)
|
||||||
|
return m_parentTabNo;
|
||||||
int tabNo = m_vo.TabNo;
|
int tabNo = m_vo.TabNo;
|
||||||
int currentLevel = m_vo.TabLevel;
|
int currentLevel = m_vo.TabLevel;
|
||||||
int parentLevel = currentLevel-1;
|
int parentLevel = currentLevel-1;
|
||||||
if (parentLevel < 0)
|
if (parentLevel < 0)
|
||||||
return tabNo;
|
return (m_parentTabNo = tabNo);
|
||||||
while (parentLevel != currentLevel)
|
while (parentLevel != currentLevel)
|
||||||
{
|
{
|
||||||
tabNo--;
|
tabNo--;
|
||||||
|
@ -3335,7 +3340,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
|
||||||
if (tabNo == 0)
|
if (tabNo == 0)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return tabNo;
|
return (m_parentTabNo = tabNo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GridTab getParentTab()
|
public GridTab getParentTab()
|
||||||
|
|
Loading…
Reference in New Issue