aboutsummaryrefslogtreecommitdiff
path: root/base85.c
diff options
context:
space:
mode:
authorJakub Narebski <jnareb@gmail.com>2011-05-27 15:50:01 +0200
committerJunio C Hamano <gitster@pobox.com>2011-05-27 11:00:42 -0700
commit42ab5d40deb6dff37705ce5aa16ac69d859a04e1 (patch)
treed5a7b49dc3bf58a87d185d9b74478e61cfdb8e7b /base85.c
parente8dd0e4063da6d0eecef1a6db99534e41f74b32e (diff)
downloadgit-42ab5d40deb6dff37705ce5aa16ac69d859a04e1.tar.gz
git-42ab5d40deb6dff37705ce5aa16ac69d859a04e1.tar.xz
gitweb.js: use setTimeout rather than setInterval in blame_incremental.js
If there is a possibility that your logic could take longer to execute than the interval time, it is recommended that you recursively call a named function using window.setTimeout rather than window.setInterval. Therefore instead of using setInterval as an alternate way of invoking handleResponse (because some web browsers call onreadystatechange only once per each distinct state, and not for each server flush), use setTimeout and reset it from handleResponse. As a bonus this allows us to get rid of timer if it turns out that web browser calls onreadystatechange on each server flush. While at it get rid of `xhr' global variable, creating it instead as local variable in startBlame and passing it as parameter, and of `pollTimer' global variable, passing it as member of xhr object (xhr.pollTimer). Signed-off-by: Jakub Narebski <jnareb@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'base85.c')
0 files changed, 0 insertions, 0 deletions