Permalink
Browse files

fix: bad seeking of array

  • Loading branch information...
1 parent d714997 commit 4e58ea21dc4e81b3aef2675e61cdcc008fa23fe1 @tomykaira tomykaira committed Jun 11, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 public/javascripts/tweets.js
View
6 public/javascripts/tweets.js
@@ -3,12 +3,12 @@
function update(){
$.getJSON("/user/friend_tweets.js", function(data){
- var i = data.length;
+ var i = 0, length = data.length;
// 既存のアイテムを削除
googlemap_controller.clearMarkers();
- while (i--){
- googlemap_controller.addFriend(data[data.length - i]);
+ for (;i < length; i++) {
+ googlemap_controller.addFriend(data[i]);
}
});
}

0 comments on commit 4e58ea2

Please sign in to comment.