Skip to content

Commit 4787465

Browse files
committed
De-duplicate code
1 parent c984595 commit 4787465

File tree

1 file changed

+1
-13
lines changed
  • src/wrap_js/makewrappers/templates

1 file changed

+1
-13
lines changed

src/wrap_js/makewrappers/templates/nan.py

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ def _generate_nan(funcname, f):
274274
'}',
275275
])
276276
result_wrap = 'str_res'
277-
elif arg == 'out_bytes_sized':
277+
elif arg.startswith('out_bytes_sized'):
278278
output_args.extend([
279279
'const uint32_t res_size = GetUInt32(info, %s, ret);' % i,
280280
'unsigned char *res_ptr = Allocate(res_size, ret);',
@@ -286,18 +286,6 @@ def _generate_nan(funcname, f):
286286
postprocessing.extend([
287287
'LocalObject res = AllocateBuffer(res_ptr, out_size, res_size, ret);'
288288
])
289-
elif arg == 'out_bytes_sized_script':
290-
output_args.extend([
291-
'const uint32_t res_size = GetUInt32(info, %s, ret);' % i,
292-
'unsigned char *res_ptr = Allocate(res_size, ret);',
293-
'size_t out_size;',
294-
])
295-
args.append('res_ptr')
296-
args.append('res_size')
297-
args.append('&out_size')
298-
postprocessing.extend([
299-
'LocalObject res = AllocateBuffer(res_ptr, out_size, res_size, ret);'
300-
])
301289
elif arg == 'out_bytes_fixedsized':
302290
output_args.extend([
303291
'const uint32_t res_size%s = GetUInt32(info, %s, ret);' % (i, i),

0 commit comments

Comments
 (0)