8000 Passing std::string by reference by ShenMian · Pull Request #193 · BoomingTech/Piccolo · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Passing std::string by reference #193

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

Merged
merged 1 commit into from
May 20, 2022
Merged
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
10 changes: 5 additions & 5 deletions engine/source/editor/source/editor_file_service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Pilot
{
/// helper function: split the input string with separator, and filter the substring
std::vector<std::string>
splitString(std::string input_string, std::string separator, std::string filter_string = "")
splitString(std::string input_string, const std::string& separator, const std::string& filter_string = "")
{
std::vector<std::string> output_string;
int pos = input_string.find(separator);
Expand Down Expand Up @@ -43,10 +43,10 @@ namespace Pilot
void EditorFileService::buildEngineFileTree()
{
ConfigManager& config_manager = ConfigManager::getInstance();
Path& path_singleton = Path::getInstance();
Path& path_singleton = Path::getInstance();

std::string asset_folder = config_manager.getAssetFolder().generic_string();
const std::vector<std::filesystem::path> file_paths = FileService::getInstance().getFiles(asset_folder);
const std::vector<std::filesystem::path> file_paths = FileService::getInstance().getFiles(asset_folder);
std::vector<std::vector<std::string>> all_file_segments;
for (const auto& path : file_paths)
{
Expand All @@ -58,7 +58,7 @@ namespace Pilot

m_file_node_array.clear();
auto root_node = std::make_shared<EditorFileNode>();
*root_node = m_root_node;
*root_node = m_root_node;
m_file_node_array.push_back(root_node);

int all_file_segments_count = all_file_segments.size();
Expand All @@ -70,7 +70,7 @@ namespace Pilot
int file_segment_count = all_file_segments[file_index].size();
for (int file_segment_index = 0; file_segment_index < file_segment_count; file_segment_index++)
{
auto file_node = std::make_shared<EditorFileNode>();
auto file_node = std::make_shared<EditorFileNode>();
file_node->m_file_name = all_file_segments[file_index][file_segment_index];
if (depth < file_segment_count - 1)
{
Expand Down
Loading
0