Skip to content

Commit 92a4a79

Browse files
committed
Swift: apply review suggestions
1 parent 8534ba0 commit 92a4a79

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

swift/xcode-autobuilder/XcodeProjectParser.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
#include "swift/xcode-autobuilder/XcodeProjectParser.h"
22

3+
#include <array>
34
#include <iostream>
45
#include <filesystem>
56
#include <unordered_map>
@@ -232,7 +233,6 @@ static std::unordered_map<std::string, std::vector<std::string>> collectWorkspac
232233
std::unordered_set<std::string> projectsBelongingToWorkspace;
233234
std::vector<fs::path> files = collectFiles(workingDir);
234235
for (auto& path : files) {
235-
std::cerr << path.c_str() << '\n';
236236
if (path.extension() == ".xcworkspace") {
237237
auto projects = readProjectsFromWorkspace(path.string());
238238
for (auto& project : projects) {
@@ -243,11 +243,11 @@ static std::unordered_map<std::string, std::vector<std::string>> collectWorkspac
243243
// a package manifest must begin with a specific header comment
244244
// see https://docs.swift.org/package-manager/PackageDescription/PackageDescription.html
245245
static constexpr std::string_view packageHeader = "// swift-tools-version:";
246-
char buffer[packageHeader.size()];
247-
if (std::ifstream{path}.read(buffer, packageHeader.size()) && buffer == packageHeader) {
246+
std::array<char, packageHeader.size()> buffer;
247+
std::string_view bufferView{buffer.data(), buffer.size()};
248+
if (std::ifstream{path}.read(buffer.data(), buffer.size()) && bufferView == packageHeader) {
248249
swiftPackageEncountered = true;
249250
}
250-
std::cerr << " " << std::string_view{buffer} << '\n';
251251
}
252252
}
253253
// Collect all projects not belonging to any workspace into a separate empty bucket

0 commit comments

Comments
 (0)