Skip to content

use std::string_view in dstring#9006

Open
kroening wants to merge 1 commit into
developfrom
dstring_string_view
Open

use std::string_view in dstring#9006
kroening wants to merge 1 commit into
developfrom
dstring_string_view

Conversation

@kroening
Copy link
Copy Markdown
Collaborator

This introduces means to construct dstringt from std::string_view, in the hope of avoiding copies of string contents.

The change is designed not to break any usage of the functions; C++17 guarantees that there's an implicit conversion from std::string to std::string_view. An exception are attempts to construct single-character strings from char.

  • Each commit message has a non-empty body, explaining why the change was made.
  • Methods or procedures I have added are documented, following the guidelines provided in CODING_STANDARD.md.
  • n/a The feature or user visible behaviour I have added or modified has been documented in the User Guide in doc/cprover-manual/
  • Regression or unit tests are included, or existing tests cover the modified code (in this case I have detailed which ones those are in the commit message).
  • My commit message includes data points confirming performance improvements (if claimed).
  • My PR is restricted to a single feature or bugfix.
  • n/a White-space or formatting changes outside the feature-related changed lines are in commits of their own.

This introduces means to construct dstringt from std::string_view, in the
hope of avoiding copies of string contents.

The change is designed not to break any usage of the functions; C++17
guarantees that there's an implicit conversion from std::string to
std::string_view.  An exception are attempts to construct single-character
strings from char.
@kroening kroening force-pushed the dstring_string_view branch from 83b15f9 to ee9b0a7 Compare May 11, 2026 17:43
@kroening kroening changed the title use std::string_view in dstring use std::string_view in dstring May 11, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 11, 2026

Codecov Report

❌ Patch coverage is 77.77778% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.11%. Comparing base (166a7d4) to head (ee9b0a7).

Files with missing lines Patch % Lines
src/util/string_hash.cpp 60.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #9006      +/-   ##
===========================================
+ Coverage    80.55%   81.11%   +0.56%     
===========================================
  Files         1707     1707              
  Lines       189016   210291   +21275     
  Branches        73       73              
===========================================
+ Hits        152261   170585   +18324     
- Misses       36755    39706    +2951     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant