File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -215,6 +215,13 @@ class ConverterObject : public BaseObject, Converter {
215
215
result.AllocateSufficientStorage (limit);
216
216
217
217
UBool flush = (flags & CONVERTER_FLAGS_FLUSH) == CONVERTER_FLAGS_FLUSH;
218
+ OnScopeLeave cleanup ([&]() {
219
+ if (flush) {
220
+ // Reset the converter state.
221
+ converter->bomSeen_ = false ;
222
+ ucnv_reset (converter->conv );
223
+ }
224
+ });
218
225
219
226
const char * source = input_obj_data;
220
227
size_t source_length = input_obj_length;
@@ -238,17 +245,10 @@ class ConverterObject : public BaseObject, Converter {
238
245
result.SetLength (target - &result[0 ]);
239
246
ret = ToBufferEndian (env, &result);
240
247
args.GetReturnValue ().Set (ret.ToLocalChecked ());
241
- goto reset ;
248
+ return ;
242
249
}
243
250
244
251
args.GetReturnValue ().Set (status);
245
-
246
- reset:
247
- if (flush) {
248
- // Reset the converter state
249
- converter->bomSeen_ = false ;
250
- ucnv_reset (converter->conv );
251
- }
252
252
}
253
253
254
254
void MemoryInfo (MemoryTracker* tracker) const override {
You can’t perform that action at this time.
0 commit comments