@@ -193,7 +193,7 @@ class Parser : public AsyncWrap {
193
193
if (num_fields_ == num_values_) {
194
194
// start of new field name
195
195
num_fields_++;
196
- if (num_fields_ == static_cast < int >( arraysize (fields_) )) {
196
+ if (num_fields_ == arraysize (fields_)) {
197
197
// ran out of space - flush to javascript land
198
198
Flush ();
199
199
num_fields_ = 1 ;
@@ -202,7 +202,7 @@ class Parser : public AsyncWrap {
202
202
fields_[num_fields_ - 1 ].Reset ();
203
203
}
204
204
205
- CHECK_LT (num_fields_, static_cast < int >( arraysize (fields_) ));
205
+ CHECK_LT (num_fields_, arraysize (fields_));
206
206
CHECK_EQ (num_fields_, num_values_ + 1 );
207
207
208
208
fields_[num_fields_ - 1 ].Update (at, length);
@@ -218,7 +218,7 @@ class Parser : public AsyncWrap {
218
218
values_[num_values_ - 1 ].Reset ();
219
219
}
220
220
221
- CHECK_LT (num_values_, static_cast < int >( arraysize (values_) ));
221
+ CHECK_LT (num_values_, arraysize (values_));
222
222
CHECK_EQ (num_values_, num_fields_);
223
223
224
224
values_[num_values_ - 1 ].Update (at, length);
@@ -385,11 +385,11 @@ class Parser : public AsyncWrap {
385
385
url_.Save ();
386
386
status_message_.Save ();
387
387
388
- for (int i = 0 ; i < num_fields_; i++) {
388
+ for (size_t i = 0 ; i < num_fields_; i++) {
389
389
fields_[i].Save ();
390
390
}
391
391
392
- for (int i = 0 ; i < num_values_; i++) {
392
+ for (size_t i = 0 ; i < num_values_; i++) {
393
393
values_[i].Save ();
394
394
}
395
395
}
@@ -637,12 +637,10 @@ class Parser : public AsyncWrap {
637
637
}
638
638
639
639
Local<Array> CreateHeaders () {
640
- // num_values_ is either -1 or the entry # of the last header
641
- // so num_values_ == 0 means there's a single header
642
640
Local<Array> headers = Array::New (env ()->isolate ());
643
641
Local<Function> fn = env ()->push_values_to_array_function ();
644
642
Local<Value> argv[NODE_PUSH_VAL_TO_ARRAY_MAX * 2 ];
645
- int i = 0 ;
643
+ size_t i = 0 ;
646
644
647
645
do {
648
646
size_t j = 0 ;
@@ -702,8 +700,8 @@ class Parser : public AsyncWrap {
702
700
StringPtr values_[32 ]; // header values
703
701
StringPtr url_;
704
702
StringPtr status_message_;
705
- int num_fields_;
706
- int num_values_;
703
+ size_t num_fields_;
704
+ size_t num_values_;
707
705
bool have_flushed_;
708
706
bool got_exception_;
709
707
Local<Object> current_buffer_;
0 commit comments