Skip to content

Commit fab4f11

Browse files
committed
✂️ remove intermediate variable
1 parent 0c8a467 commit fab4f11

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

ext/sqlite3/aggregator.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,6 @@ rb_sqlite3_define_aggregator2(VALUE self, VALUE aggregator, VALUE ruby_name)
208208
/* define_aggregator is added as a method to SQLite3::Database in database.c */
209209
sqlite3RubyPtr ctx;
210210
int arity, status;
211-
const char *name;
212211
VALUE aw;
213212
VALUE aggregators;
214213

@@ -238,15 +237,13 @@ rb_sqlite3_define_aggregator2(VALUE self, VALUE aggregator, VALUE ruby_name)
238237
}
239238
aggregators = rb_iv_get(self, "-aggregators");
240239

241-
name = StringValueCStr(ruby_name);
242-
243240
aw = rb_class_new_instance(0, NULL, cAggregatorWrapper);
244241
rb_iv_set(aw, "-handler_klass", aggregator);
245242
rb_iv_set(aw, "-instances", rb_ary_new());
246243

247244
status = sqlite3_create_function(
248245
ctx->db,
249-
name,
246+
StringValueCStr(ruby_name),
250247
arity,
251248
SQLITE_UTF8,
252249
(void*)aw,

0 commit comments

Comments
 (0)