Project

General

Profile

Enhancement(機能追加・改善) #1197

[optimization] MemberRelationshipTable::getFriendMemberIds() などで MemberTable::getInactiveMemberIds() の結果を in_array() するのをやめる

Added by Yuki Kan almost 10 years ago. Updated over 9 years ago.

Status:
Fixed(完了)
Priority:
Normal(通常)
Assignee:
Target version:
Start date:
2010-06-23
Due date:
2010-06-23
% Done:

100%


Description

Overview

MemberRelationshipTable::getFriendMemberIds() などで MemberTable::getInactiveMemberIds() の結果を in_array() するのをやめる

具体的には以下のような変更になる。

Index: MemberTable.class.php
===================================================================
--- MemberTable.class.php    (revision 40763)
+++ MemberTable.class.php    (revision 40764)
@@ -65,7 +65,7 @@
     $memberIds = array();
     foreach ($members as $member)
     {
-      $memberIds[] = $member[0];
+      $memberIds[$member[0]] = $member[0];
     }

     return $memberIds;

Index: MemberRelationshipTable.class.php
===================================================================
--- MemberRelationshipTable.class.php    (revision 40763)
+++ MemberRelationshipTable.class.php    (revision 40764)
@@ -67,7 +67,7 @@

     foreach ($friendMemberIds as $friend)
     {
-      if (!in_array($friend[0], $inactiveMemberIds))
+      if (!isset($inactiveMemberIds[$friend[0]]))
       {
         $result[] = $friend[0];
       }

Associated revisions

Revision 482681b6 (diff)
Added by Yuki Kan almost 10 years ago

fixed using in_array() to get result. (fixes #1197)

Revision 484780ed (diff)
Added by Kousuke Ebihara almost 10 years ago

Revert "fixed using in_array() to get result. (fixes #1197)"

This reverts commit 482681b600fe4d4348af8c80160796b5a2142457.

Revision 31efafc4 (diff)
Added by Yuki Kan almost 10 years ago

fixed using in_array() to get result. (fixes #1197)

History

#1 Updated by Kousuke Ebihara almost 10 years ago

  • Status changed from Accepted(着手) to Pending Review(レビュー待ち)
  • % Done changed from 0 to 50

更新履歴 484780ed0b7f4c26b5a0318e79276d6f16e4121e で適用されました。

#2 Updated by Yuki Kan almost 10 years ago

更新履歴 482681b600fe4d4348af8c80160796b5a2142457 で適用されました。

#3 Updated by Yuki Kan almost 10 years ago

更新履歴 31efafc427cd509d0681b7a65fe1d36f78be9bb3 で適用されました。

#4 Updated by Shogo Kawahara over 9 years ago

  • Subject changed from 【チューニング】MemberRelationshipTable::getFriendMemberIds() などで MemberTable::getInactiveMemberIds() の結果を in_array() するのをやめる to [optimization] MemberRelationshipTable::getFriendMemberIds() などで MemberTable::getInactiveMemberIds() の結果を in_array() するのをやめる

#5 Updated by Shogo Kawahara over 9 years ago

  • Status changed from Pending Review(レビュー待ち) to Pending Testing(テスト待ち)
  • % Done changed from 50 to 70

#6 Updated by Kousuke Ebihara over 9 years ago

  • Status changed from Pending Testing(テスト待ち) to Fixed(完了)
  • % Done changed from 70 to 100

Also available in: Atom PDF