Commit 8a77885
authored
### Rationale for this change
The grouper code was creating a `shared_ptr<DataType>` for every key type, even when it wasn't needed. This resulted in unnecessary reference counting operations. For example, `BooleanKeyEncoder` and `NullKeyEncoder` don't require a `shared_ptr` in their constructors, yet we were creating one for every key of those types.
### What changes are included in this PR?
Changed `GrouperImpl::Make()` to use `TypeHolder` references directly and only call `GetSharedPtr()` when needed by encoder constructors. This eliminates `shared_ptr` creation for `Type::BOOL` and `Type::NA` cases. Other encoder types (dictionary, fixed-width, binary) still require `shared_ptr` since their constructors take `shared_ptr<DataType>` parameters for ownership.
### Are these changes tested?
Yes, existing tests.
### Are there any user-facing changes?
No.
* GitHub Issue: #49065
Authored-by: Hyukjin Kwon <gurwls223@apache.org>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
1 parent 12cdb09 commit 8a77885
1 file changed
+16
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
345 | | - | |
| 344 | + | |
346 | 345 | | |
347 | | - | |
| 346 | + | |
348 | 347 | | |
349 | 348 | | |
350 | 349 | | |
351 | 350 | | |
352 | | - | |
353 | | - | |
354 | | - | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
355 | 354 | | |
356 | 355 | | |
357 | 356 | | |
358 | | - | |
359 | | - | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
363 | | - | |
364 | | - | |
365 | | - | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
366 | 366 | | |
367 | 367 | | |
368 | 368 | | |
369 | | - | |
| 369 | + | |
370 | 370 | | |
371 | | - | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
375 | | - | |
| 376 | + | |
376 | 377 | | |
377 | 378 | | |
378 | 379 | | |
379 | 380 | | |
380 | | - | |
| 381 | + | |
381 | 382 | | |
382 | 383 | | |
383 | 384 | | |
| |||
0 commit comments