Hi,

I'm trying to implement a custom <tree/> view which displays the most recent 
500 log messages
(row0 = most recent, row499 = oldest). What's the most efficient way to 
implement a bounded stack
(LIFO buffer) in javascript?

I was thinking this:

var boundedStack = new Array(500);
function push(o) {
  if (boundedStack.unshift(o) > 500)
    boundedStack.pop();
}

Is there anything more efficient? I'm looking for the most performant 
implementation.

Thank you for any advice,
Eric H. Jung
FoxyProxy--Take Back Your Privacy!  (Coming This Weekend)

_______________________________________________
Project_owners mailing list
[email protected]
http://mozdev.org/mailman/listinfo/project_owners

Reply via email to