Skip to content

Commit 06d1bda

Browse files
committed
A handful of cosmetic changes
1 parent 3de6409 commit 06d1bda

File tree

1 file changed

+8
-25
lines changed

1 file changed

+8
-25
lines changed

src/native/clr/host/fastdev-assemblies.cc

Lines changed: 8 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,11 @@ auto FastDevAssemblies::open_assembly (std::string_view const& name, int64_t &si
2424
return nullptr;
2525
}
2626

27-
if (override_dir_fd == -1) [[unlikely]] {
27+
// NOTE: override_dir will be kept open, we have no way of knowing when it will be no longer
28+
// needed
29+
if (override_dir_fd < 0) [[unlikely]] {
2830
std::lock_guard dir_lock { override_dir_lock };
29-
if (override_dir_fd == -1) [[likely]] {
31+
if (override_dir_fd < 0) [[likely]] {
3032
override_dir = opendir (override_dir_path.c_str ());
3133
if (override_dir == nullptr) [[unlikely]] {
3234
log_warn (LOG_ASSEMBLY, "Failed to open override dir '{}'. {}", override_dir_path, strerror (errno));
@@ -44,27 +46,14 @@ auto FastDevAssemblies::open_assembly (std::string_view const& name, int64_t &si
4446
);
4547

4648
if (!Util::file_exists (override_dir_fd, name)) {
47-
log_warn (
48-
LOG_ASSEMBLY,
49-
"FastDev assembly '{}' not found.",
50-
name
51-
);
49+
log_warn (LOG_ASSEMBLY, "FastDev assembly '{}' not found.", name);
5250
return nullptr;
5351
}
54-
55-
log_debug (
56-
LOG_ASSEMBLY,
57-
"Found FastDev assembly '{}'",
58-
name
59-
);
52+
log_debug (LOG_ASSEMBLY, "Found FastDev assembly '{}'", name);
6053

6154
auto file_size = Util::get_file_size_at (override_dir_fd, name);
6255
if (!file_size) [[unlikely]] {
63-
log_warn (
64-
LOG_ASSEMBLY,
65-
"Unable to determine FastDev assembly '{}' file size",
66-
name
67-
);
56+
log_warn (LOG_ASSEMBLY, "Unable to determine FastDev assembly '{}' file size", name);
6857
return nullptr;
6958
}
7059

@@ -118,13 +107,7 @@ auto FastDevAssemblies::open_assembly (std::string_view const& name, int64_t &si
118107
size = 0;
119108
return nullptr;
120109
}
121-
122-
log_debug (
123-
LOG_ASSEMBLY,
124-
"Read {} bytes of FastDev assembly '{}'",
125-
nread,
126-
name
127-
);
110+
log_debug (LOG_ASSEMBLY, "Read {} bytes of FastDev assembly '{}'", nread, name);
128111

129112
return reinterpret_cast<void*>(buffer);
130113
}

0 commit comments

Comments
 (0)