@@ -33,7 +33,7 @@ impl cmplx : ops::Mul<cmplx,cmplx> {
33
33
}
34
34
35
35
impl cmplx : ops:: Add < cmplx , cmplx > {
36
- pure fn add ( x : & cmplx ) -> cmplx {
36
+ pure fn add ( & self , x : & cmplx ) -> cmplx {
37
37
cmplx {
38
38
re : self . re + ( * x) . re ,
39
39
im : self . im + ( * x) . im
@@ -145,7 +145,7 @@ fn writer(path: ~str, writech: comm::Chan<comm::Chan<line>>, size: uint)
145
145
}
146
146
else {
147
147
debug ! ( "S %u" , aline. i) ;
148
- lines. insert ( aline. i , aline. b ) ;
148
+ lines. insert ( aline. i , copy aline. b ) ; // FIXME: bad for perf
149
149
} ;
150
150
i += 1_ u;
151
151
}
@@ -160,7 +160,7 @@ fn main() {
160
160
} ;
161
161
162
162
let path = if vec:: len ( args) < 4_ u { ~"" }
163
- else { args[ 3 ] } ;
163
+ else { copy args[ 3 ] } ; // FIXME: bad for perf
164
164
165
165
let yieldevery = if vec:: len ( args) < 3_ u { 10_ u }
166
166
else { uint:: from_str ( args[ 2 ] ) . get ( ) } ;
@@ -170,8 +170,8 @@ fn main() {
170
170
171
171
let writep = comm:: Port ( ) ;
172
172
let writech = comm:: Chan ( & writep) ;
173
- do task:: spawn {
174
- writer( path, writech, size) ;
173
+ do task:: spawn | move path| {
174
+ writer ( copy path, writech, size) ;
175
175
} ;
176
176
let ch = comm:: recv ( writep) ;
177
177
for uint:: range( 0_ u, size) |j| {
0 commit comments