Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: make workspace const in add_constant_feature #4481

Merged
merged 2 commits into from
Feb 1, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion vowpalwabbit/core/include/vw/core/vw.h
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ float get_confidence(example* ec);
feature* get_features(VW::workspace& all, example* ec, size_t& feature_number);
void return_features(feature* f);

void add_constant_feature(VW::workspace& all, example* ec);
void add_constant_feature(const VW::workspace& all, example* ec);
void add_label(example* ec, float label, float weight = 1, float base = 0);

// notify VW that you are done with the example.
Expand Down
2 changes: 1 addition & 1 deletion vowpalwabbit/core/src/vw.cc
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ VW::feature* VW::get_features(VW::workspace& all, example* ec, size_t& feature_n

void VW::return_features(feature* f) { delete[] f; }

void VW::add_constant_feature(VW::workspace& all, VW::example* ec)
void VW::add_constant_feature(const VW::workspace& all, VW::example* ec)
{
ec->indices.push_back(VW::details::CONSTANT_NAMESPACE);
ec->feature_space[VW::details::CONSTANT_NAMESPACE].push_back(
Expand Down