mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-01 07:38:46 +00:00
Replace our only dynamic_cast with old-school casting
dynamic_cast requires rtti to be enabled. Now, this isn't a big problem, but since this is our only dynamic_cast in the entire codebase, and it's not serving an important function, we can just replace it. See #7764
This commit is contained in:
parent
d655d24148
commit
abaa057e5c
1 changed files with 3 additions and 1 deletions
|
@ -445,7 +445,9 @@ static std::unique_ptr<output_stream_t> create_output_stream_for_builtin(
|
|||
// Our IO redirection is to an internal buffer, e.g. a command substitution.
|
||||
// We will write directly to it.
|
||||
std::shared_ptr<io_buffer_t> buffer =
|
||||
dynamic_cast<const io_bufferfill_t *>(io.get())->buffer();
|
||||
// (this is not a dynamic_cast because that needs rtti,
|
||||
// and we currently use it nowhere else)
|
||||
((const io_bufferfill_t *)io.get())->buffer();
|
||||
return make_unique<buffered_output_stream_t>(buffer);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue