IDEMPIERE-4800 Performance - avoid multiple for in GridTab.getParentTabNo (#699)

This commit is contained in:
Carlos Ruiz 2021-05-27 08:38:02 +02:00 committed by GitHub
parent 17a80a0beb
commit 6d78119006
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 3 deletions

View File

@ -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";
@ -2854,6 +2854,9 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
private boolean m_updateWindowContext = true;
// Cached parent Tab No
private int m_parentTabNo = -1;
/**
*
* @return list of active call out for this tab
@ -3323,11 +3326,13 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
*/
private int getParentTabNo()
{
if (m_parentTabNo >= 0)
return m_parentTabNo;
int tabNo = m_vo.TabNo;
int currentLevel = m_vo.TabLevel;
int parentLevel = currentLevel-1;
if (parentLevel < 0)
return tabNo;
return (m_parentTabNo = tabNo);
while (parentLevel != currentLevel)
{
tabNo--;
@ -3335,7 +3340,7 @@ public class GridTab implements DataStatusListener, Evaluatee, Serializable
if (tabNo == 0)
break;
}
return tabNo;
return (m_parentTabNo = tabNo);
}
public GridTab getParentTab()