Skip to content

Commit

Permalink
refactor: make workspace const in add_constant_feature (#4481)
Browse files Browse the repository at this point in the history
  • Loading branch information
jackgerrits authored Feb 1, 2023
1 parent c64fdd9 commit 1cff721
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit 1cff721

Please sign in to comment.