-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviews.apache.org/r/75128/#review226745
-----------------------------------------------------------




src/slave/containerizer/device_manager/device_manager.cpp
Lines 58-59 (patched)
<https://reviews.apache.org/r/75128/#comment315012>

    it's unfortunate the compiler isn't understanding that we're returning in 
all cases here?
    
    a simpler and more idiomatic case here is this one-liner:
    
    ```
          switch (type) {
            case DeviceManager::NonWildcardEntry::Selector::Type::BLOCK:
              return Entry::Selector::Type::BLOCK;
            case DeviceManager::NonWildcardEntry::Selector::Type::CHARACTER:
              return Entry::Selector::Type::CHARACTER;
          }
          UNREACHABLE();
    ```


- Benjamin Mahler


On July 30, 2024, 2:22 p.m., Jason Zhou wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviews.apache.org/r/75128/
> -----------------------------------------------------------
> 
> (Updated July 30, 2024, 2:22 p.m.)
> 
> 
> Review request for mesos and Benjamin Mahler.
> 
> 
> Repository: mesos
> 
> 
> Description
> -------
> 
> Currently, reviewbot is failing from a 'control reaches end of non-void
> function' error due to a switch case inside a lambda in the device
> manager code. We patch it up with a lambda with a default case that can
> return an Error
> 
> 
> Diffs
> -----
> 
>   src/slave/containerizer/device_manager/device_manager.cpp 
> 9c3e6c00cedff5aeb4e3726adb002a29517b254f 
> 
> 
> Diff: https://reviews.apache.org/r/75128/diff/1/
> 
> 
> Testing
> -------
> 
> Existing DeviceManager and CGROUPS2 tests pass
> 
> 
> Thanks,
> 
> Jason Zhou
> 
>

Reply via email to