浏览代码

Internal: suppressed a warning on ormCaseLog

git-svn-id: http://svn.code.sf.net/p/itop/code/trunk@1514 a333f486-631f-4898-b8df-5754b55c2be0
romainq 13 年之前
父节点
当前提交
689dfe3774
共有 1 个文件被更改,包括 2 次插入3 次删除
  1. 2 3
      core/ormcaselog.class.inc.php

+ 2 - 3
core/ormcaselog.class.inc.php

@@ -175,8 +175,7 @@ class ormCaseLog {
 	 */
 	public function GetLatestEntry()
 	{
-		$iLast = count($this->m_aIndex) - 1;
-		$aLastEntry = $this->m_aIndex[$iLast];
+		$aLastEntry = end($this->m_aIndex);
 		$sRes = substr($this->m_sLog, $aLastEntry['separator_length'], $aLastEntry['text_length']);
 		return $sRes;
 	}
@@ -187,7 +186,7 @@ class ormCaseLog {
 	 */
 	public function GetLatestEntryIndex()
 	{
-		$iLast = count($this->m_aIndex) - 1;
+		$iLast = end(array_keys($this->m_aIndex));
 		return $iLast;
 	}
 }