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

EZ const std:string -> string_view #12245

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions velox/type/Type.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ bool RowType::containsChild(std::string_view name) const {
return std::find(names_.begin(), names_.end(), name) != names_.end();
}

uint32_t RowType::getChildIdx(const std::string& name) const {
uint32_t RowType::getChildIdx(std::string_view name) const {
auto index = getChildIdxIfExists(name);
if (!index.has_value()) {
VELOX_USER_FAIL(makeFieldNotFoundErrorMessage(name, names_));
Expand All @@ -430,7 +430,7 @@ uint32_t RowType::getChildIdx(const std::string& name) const {
}

std::optional<uint32_t> RowType::getChildIdxIfExists(
const std::string& name) const {
std::string_view name) const {
for (uint32_t i = 0; i < names_.size(); i++) {
if (names_.at(i) == name) {
return i;
Expand Down
4 changes: 2 additions & 2 deletions velox/type/Type.h
Original file line number Diff line number Diff line change
Expand Up @@ -1026,9 +1026,9 @@ class RowType : public TypeBase<TypeKind::ROW> {

bool containsChild(std::string_view name) const;

uint32_t getChildIdx(const std::string& name) const;
uint32_t getChildIdx(std::string_view name) const;

std::optional<uint32_t> getChildIdxIfExists(const std::string& name) const;
std::optional<uint32_t> getChildIdxIfExists(std::string_view name) const;

const std::string& nameOf(uint32_t idx) const {
VELOX_CHECK_LT(idx, names_.size());
Expand Down
Loading