mirror of https://github.com/adamdruppe/arsd.git
bug in my stack class
This commit is contained in:
parent
ab1c94de64
commit
9fc6975ada
6
dom.d
6
dom.d
|
@ -886,7 +886,7 @@ class Element {
|
||||||
version(dom_node_indexes)
|
version(dom_node_indexes)
|
||||||
this.dataset.nodeIndex = to!string(&(this.attributes));
|
this.dataset.nodeIndex = to!string(&(this.attributes));
|
||||||
|
|
||||||
assert(_tagName.indexOf(" ") == -1);
|
assert(_tagName.indexOf(" ") == -1);//, "<" ~ _tagName ~ "> is invalid");
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Convenience constructor when you don't care about the parentDocument. Note this might break things on the document.
|
/// Convenience constructor when you don't care about the parentDocument. Note this might break things on the document.
|
||||||
|
@ -5114,16 +5114,18 @@ class StyleSheet {
|
||||||
final class Stack(T) {
|
final class Stack(T) {
|
||||||
this() {
|
this() {
|
||||||
internalLength = 0;
|
internalLength = 0;
|
||||||
arr = initialBuffer;
|
arr = initialBuffer[];
|
||||||
}
|
}
|
||||||
|
|
||||||
///.
|
///.
|
||||||
void push(T t) {
|
void push(T t) {
|
||||||
if(internalLength >= arr.length) {
|
if(internalLength >= arr.length) {
|
||||||
|
auto oldarr = arr;
|
||||||
if(arr.length < 4096)
|
if(arr.length < 4096)
|
||||||
arr = new T[arr.length * 2];
|
arr = new T[arr.length * 2];
|
||||||
else
|
else
|
||||||
arr = new T[arr.length + 4096];
|
arr = new T[arr.length + 4096];
|
||||||
|
arr[0 .. oldarr.length] = oldarr[];
|
||||||
}
|
}
|
||||||
|
|
||||||
arr[internalLength] = t;
|
arr[internalLength] = t;
|
||||||
|
|
Loading…
Reference in New Issue