Permalink
Browse files

Fix a slight error and remove some new tries at fixing the GC problems

  • Loading branch information...
1 parent b283a03 commit 96a77994567af8f97f26eb37f89a0f0ad8d4fdf5 @olabini committed Jul 18, 2009
Showing with 1 addition and 14 deletions.
  1. +0 −13 ext/ruby/src/java/org/yecht/ruby/YechtYAML.java
  2. +1 −1 src/main/org/yecht/Node.java
View
13 ext/ruby/src/java/org/yecht/ruby/YechtYAML.java
@@ -1049,14 +1049,6 @@ public static IRubyObject transform(IRubyObject self) {
org.yecht.Node n = null;
ObjectSpace os = runtime.getObjectSpace();
- List<Object> holder = null;
- if(orig_n.shortcut instanceof List) {
- holder = (List<Object>)orig_n.shortcut;
- } else {
- holder = new LinkedList<Object>();
- }
- holder.add(t);
-
switch(orig_n.kind) {
case Map:
n = org.yecht.Node.allocMap();
@@ -1065,8 +1057,6 @@ public static IRubyObject transform(IRubyObject self) {
for(int i=0; i < dm.idx; i++) {
IRubyObject k = os.id2ref(orig_n.mapRead(MapPart.Key, i)).callMethod(ctx, "transform");
IRubyObject v = os.id2ref(orig_n.mapRead(MapPart.Value, i)).callMethod(ctx, "transform");
- holder.add(k);
- holder.add(v);
n.mapAdd(os.idOf(k),
os.idOf(v));
}
@@ -1077,7 +1067,6 @@ public static IRubyObject transform(IRubyObject self) {
Data.Seq ds = (Data.Seq)orig_n.data;
for(int i=0; i < ds.idx; i++) {
IRubyObject itm = os.id2ref(orig_n.seqRead(i)).callMethod(ctx, "transform");
- holder.add(itm);
n.seqAdd(os.idOf(itm));
}
break;
@@ -1097,10 +1086,8 @@ public static IRubyObject transform(IRubyObject self) {
}
n.id = os.idOf(t);
- n.shortcut = holder;
// System.err.println("syck_node_transform(), setting id of object on: " + n);
IRubyObject result = ((RubyModule)((RubyModule)runtime.getModule("YAML")).getConstant("Yecht")).getConstant("DefaultResolver").callMethod(ctx, "node_import", t);
- holder.add(result);
return result;
}
}
View
2 src/main/org/yecht/Node.java
@@ -47,7 +47,7 @@ public void strBlowAwayCommas() {
if(buf[go] == ',') {
d.len--;
end--;
- System.arraycopy(buf, go+1, buf, go, go-end);
+ System.arraycopy(buf, go+1, buf, go, end-go);
}
}
}

0 comments on commit 96a7799

Please sign in to comment.