[PR #377] refactor: Add empty() method to TagSet and use it for emptiness checks #400

Open
opened 2026-10-26 09:49:55 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/3FS/pull/377
Author: @yurekami
Created: 1/4/2026
Status: 🔄 Open

Base: main ← Head: refactor/tagset-empty-method


📝 Commits (1)

  • d44d1a9 refactor: Add empty() method to TagSet and use it for emptiness checks

📊 Changes

2 files changed (+4 additions, -3 deletions)

View changed files

📝 src/common/monitor/Sample.h (+1 -0)
📝 src/common/monitor/ScopedMetricsWriter.h (+3 -3)

📄 Description

Summary

  • Adds empty() method to TagSet class for consistent container interface
  • Replaces .size() > 0 checks with !.empty() in ScopedMetricsWriter

Motivation

This follows the clang-tidy readability-container-size-empty guideline which recommends using empty() instead of comparing size() to zero.

Benefits:

  • Readability: !.empty() is more idiomatic and clearer than .size() > 0
  • Consistency: Aligns TagSet with standard container interfaces
  • Future-proofing: empty() can be more efficient than size() == 0 for some container types

Changes

  1. src/common/monitor/Sample.h: Added bool empty() const method to TagSet class
  2. src/common/monitor/ScopedMetricsWriter.h: Replaced 3 instances of .size() > 0 with !.empty()

Test plan

  • Existing tests should pass (no behavioral change)
  • Code review for correctness

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/3FS/pull/377 **Author:** [@yurekami](https://github.com/yurekami) **Created:** 1/4/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `refactor/tagset-empty-method` --- ### 📝 Commits (1) - [`d44d1a9`](https://github.com/deepseek-ai/3FS/commit/d44d1a9e8a3820fcbcd6910223ba7f3b1db10c63) refactor: Add empty() method to TagSet and use it for emptiness checks ### 📊 Changes **2 files changed** (+4 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/common/monitor/Sample.h` (+1 -0) 📝 `src/common/monitor/ScopedMetricsWriter.h` (+3 -3) </details> ### 📄 Description ## Summary - Adds `empty()` method to `TagSet` class for consistent container interface - Replaces `.size() > 0` checks with `!.empty()` in `ScopedMetricsWriter` ## Motivation This follows the clang-tidy `readability-container-size-empty` guideline which recommends using `empty()` instead of comparing `size()` to zero. Benefits: - **Readability**: `!.empty()` is more idiomatic and clearer than `.size() > 0` - **Consistency**: Aligns `TagSet` with standard container interfaces - **Future-proofing**: `empty()` can be more efficient than `size() == 0` for some container types ## Changes 1. **`src/common/monitor/Sample.h`**: Added `bool empty() const` method to `TagSet` class 2. **`src/common/monitor/ScopedMetricsWriter.h`**: Replaced 3 instances of `.size() > 0` with `!.empty()` ## Test plan - [ ] Existing tests should pass (no behavioral change) - [ ] Code review for correctness 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/3FS#400
No description provided.