8000 Make conditionals that test emscripten_build constexpr by elliottt · Pull Request #8859 · sorbet/sorbet · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make conditionals that test emscripten_build constexpr #8859

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 9, 2025
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
2 changes: 1 addition & 1 deletion common/Subprocess.cc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class FileActions {
// and returns the child's stdout and status code
optional<sorbet::Subprocess::Result> sorbet::Subprocess::spawn(string executable, vector<string> arguments,
optional<string_view> stdinContents) {
if (emscripten_build) {
if constexpr (emscripten_build) {
return nullopt;
}
int stdinPipe[2];
Expand Down
2 changes: 1 addition & 1 deletion common/concurrency/ConcurrentQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ template <class Elem, class Queue> class AbstractConcurrentBoundedQueue {
inline DequeueResult wait_pop_timed(Elem &elem, std::chrono::duration<Rep, Period> const &timeout,
spdlog::logger &log, bool silent = false) noexcept {
DequeueResult ret;
if (!sorbet::emscripten_build) {
if constexpr (!sorbet::emscripten_build) {
ret.shouldRetry = elementsLeftToPush.load(std::memory_order_acquire) != 0;
if (ret.shouldRetry) {
std::unique_ptr<sorbet::Timer> time;
Expand Down
2 changes: 1 addition & 1 deletion common/concurrency/WorkerPoolImpl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ WorkerPool::~WorkerPool() {

WorkerPoolImpl::WorkerPoolImpl(int size, spdlog::logger &logger) : _size(size), logger(logger) {
logger.trace("Creating {} worker threads", _size);
if (sorbet::emscripten_build) {
if constexpr (sorbet::emscripten_build) {
ENFORCE_NO_TIMER(size == 0);
this->_size = 0;
} else {
Expand Down
0