Skip to content

Commit

Permalink
Automated Code Change
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 659908372
  • Loading branch information
tensorflower-gardener authored and copybara-github committed Aug 6, 2024
1 parent 6ae6ec1 commit 4756a86
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions xla/tsl/concurrency/async_value_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class AsyncValueRef {
AsyncValueRef(const AsyncValueRef&) = default;
AsyncValueRef& operator=(const AsyncValueRef&) = default;

AsyncValueRef(AsyncValueRef&&) = default;
AsyncValueRef& operator=(AsyncValueRef&&) = default;
AsyncValueRef(AsyncValueRef&&) noexcept = default;
AsyncValueRef& operator=(AsyncValueRef&&) noexcept = default;

explicit AsyncValueRef(RCReference<AsyncValue> value)
: value_(std::move(value)) {}
Expand Down Expand Up @@ -953,13 +953,13 @@ class AsyncValueOwningRef {
AsyncValueOwningRef(const AsyncValueOwningRef&) = delete;
AsyncValueOwningRef& operator=(const AsyncValueOwningRef&) = delete;

AsyncValueOwningRef& operator=(AsyncValueOwningRef&& other) {
AsyncValueOwningRef& operator=(AsyncValueOwningRef&& other) noexcept {
Destroy();
std::swap(value_, other.value_);
return *this;
}

AsyncValueOwningRef(AsyncValueOwningRef&& other) {
AsyncValueOwningRef(AsyncValueOwningRef&& other) noexcept {
Destroy();
std::swap(value_, other.value_);
}
Expand Down
8 changes: 4 additions & 4 deletions xla/tsl/concurrency/ref_count.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,15 @@ class RCReference {
public:
RCReference() : pointer_(nullptr) {}

RCReference(RCReference&& other) : pointer_(other.pointer_) {
RCReference(RCReference&& other) noexcept : pointer_(other.pointer_) {
other.pointer_ = nullptr;
}

RCReference(const RCReference& other) : pointer_(other.pointer_) {
if (pointer_) pointer_->AddRef();
}

RCReference& operator=(RCReference&& other) {
RCReference& operator=(RCReference&& other) noexcept {
reset(other.pointer_);
other.pointer_ = nullptr;
return *this;
Expand Down Expand Up @@ -187,7 +187,7 @@ class RCReference {

explicit operator bool() const { return pointer_ != nullptr; }

void swap(RCReference& other) {
void swap(RCReference& other) noexcept {
using std::swap;
swap(pointer_, other.pointer_);
}
Expand Down Expand Up @@ -256,7 +256,7 @@ RCReference<T> MakeRef(Args&&... args) {
}
// For ADL style swap.
template <typename T>
void swap(RCReference<T>& a, RCReference<T>& b) {
void swap(RCReference<T>& a, RCReference<T>& b) noexcept {
a.swap(b);
}

Expand Down

0 comments on commit 4756a86

Please sign in to comment.