@@ -189,7 +189,7 @@ class Parser : public BaseObject {
189
189
if (num_fields_ == num_values_) {
190
190
// start of new field name
191
191
num_fields_++;
192
- if (num_fields_ == static_cast < int >( arraysize (fields_) )) {
192
+ if (num_fields_ == arraysize (fields_)) {
193
193
// ran out of space - flush to javascript land
194
194
Flush ();
195
195
num_fields_ = 1 ;
@@ -198,7 +198,7 @@ class Parser : public BaseObject {
198
198
fields_[num_fields_ - 1 ].Reset ();
199
199
}
200
200
201
- CHECK_LT (num_fields_, static_cast < int >( arraysize (fields_) ));
201
+ CHECK_LT (num_fields_, arraysize (fields_));
202
202
CHECK_EQ (num_fields_, num_values_ + 1 );
203
203
204
204
fields_[num_fields_ - 1 ].Update (at, length);
@@ -214,7 +214,7 @@ class Parser : public BaseObject {
214
214
values_[num_values_ - 1 ].Reset ();
215
215
}
216
216
217
- CHECK_LT (num_values_, static_cast < int >( arraysize (values_) ));
217
+ CHECK_LT (num_values_, arraysize (values_));
218
218
CHECK_EQ (num_values_, num_fields_);
219
219
220
220
values_[num_values_ - 1 ].Update (at, length);
@@ -377,11 +377,11 @@ class Parser : public BaseObject {
377
377
url_.Save ();
378
378
status_message_.Save ();
379
379
380
- for (int i = 0 ; i < num_fields_; i++) {
380
+ for (size_t i = 0 ; i < num_fields_; i++) {
381
381
fields_[i].Save ();
382
382
}
383
383
384
- for (int i = 0 ; i < num_values_; i++) {
384
+ for (size_t i = 0 ; i < num_values_; i++) {
385
385
values_[i].Save ();
386
386
}
387
387
}
@@ -631,11 +631,9 @@ class Parser : public BaseObject {
631
631
}
632
632
633
633
Local<Array> CreateHeaders () {
634
- // num_values_ is either -1 or the entry # of the last header
635
- // so num_values_ == 0 means there's a single header
636
634
Local<Array> headers = Array::New (env ()->isolate (), 2 * num_values_);
637
635
638
- for (int i = 0 ; i < num_values_; ++i) {
636
+ for (size_t i = 0 ; i < num_values_; ++i) {
639
637
headers->Set (2 * i, fields_[i].ToString (env ()));
640
638
headers->Set (2 * i + 1 , values_[i].ToString (env ()));
641
639
}
@@ -687,8 +685,8 @@ class Parser : public BaseObject {
687
685
StringPtr values_[32 ]; // header values
688
686
StringPtr url_;
689
687
StringPtr status_message_;
690
- int num_fields_;
691
- int num_values_;
688
+ size_t num_fields_;
689
+ size_t num_values_;
692
690
bool have_flushed_;
693
691
bool got_exception_;
694
692
Local<Object> current_buffer_;
0 commit comments