Commit 0d9af06
streaming.c: remove enum/function/vtbl indirection
Remove the indirection of discovering a function pointer to use via an
enum and virtual table. This refactors code added in
46bf043 (streaming: a new API to read from the object store,
2011-05-11).
We can instead simply return an "open_istream_fn" for use from the
"istream_source()" selector function directly. This allows us to get
rid of the "incore", "loose" and "pack_non_delta" enum
variables. We'll return the functions instead.
The "stream_error" variable in that enum can likewise go in favor of
returning NULL, which is what the open_istream() was doing when it got
that value anyway.
We can thus remove the entire enum, and the "open_istream_tbl" virtual
table that (indirectly) referenced it.
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>1 parent b655283 commit 0d9af06
1 file changed
+11
-25
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | 11 | | |
19 | 12 | | |
20 | 13 | | |
| |||
424 | 417 | | |
425 | 418 | | |
426 | 419 | | |
427 | | - | |
428 | | - | |
429 | | - | |
430 | | - | |
431 | | - | |
432 | | - | |
433 | | - | |
434 | | - | |
435 | | - | |
436 | | - | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
437 | 424 | | |
438 | 425 | | |
439 | 426 | | |
| |||
442 | 429 | | |
443 | 430 | | |
444 | 431 | | |
445 | | - | |
| 432 | + | |
446 | 433 | | |
447 | 434 | | |
448 | 435 | | |
449 | | - | |
| 436 | + | |
450 | 437 | | |
451 | 438 | | |
452 | | - | |
| 439 | + | |
453 | 440 | | |
454 | 441 | | |
455 | | - | |
| 442 | + | |
456 | 443 | | |
457 | 444 | | |
458 | 445 | | |
459 | | - | |
460 | 446 | | |
461 | 447 | | |
462 | 448 | | |
| |||
482 | 468 | | |
483 | 469 | | |
484 | 470 | | |
485 | | - | |
| 471 | + | |
486 | 472 | | |
487 | | - | |
| 473 | + | |
488 | 474 | | |
489 | 475 | | |
490 | 476 | | |
491 | | - | |
| 477 | + | |
492 | 478 | | |
493 | 479 | | |
494 | 480 | | |
| |||
0 commit comments