From 3f133dd5863f3801f57ac7ec98791c72506b5234 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Wed, 20 Jul 2022 13:49:18 -0700 Subject: [PATCH] use data() instead of &[0] No need for C pointer manipulation. Removed data() for string_view as [] can be used without. Signed-off-by: Rosen Penev --- src/playlist/cue/CueParser.cxx | 2 +- src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/playlist/cue/CueParser.cxx b/src/playlist/cue/CueParser.cxx index bb2f107d8..4e79027a4 100644 --- a/src/playlist/cue/CueParser.cxx +++ b/src/playlist/cue/CueParser.cxx @@ -43,7 +43,7 @@ cue_next_word(std::string_view &src) noexcept static std::string_view cue_next_quoted(std::string_view &src) noexcept { - assert(src.data()[-1] == '"'); + assert(src[-1] == '"'); auto end = src.find('"'); if (end == src.npos) diff --git a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx index 1f361506b..2538baf17 100644 --- a/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx +++ b/src/playlist/plugins/EmbeddedCuePlaylistPlugin.cxx @@ -106,7 +106,7 @@ embcue_playlist_open_uri(const char *uri, playlist->cuesheet = std::move(extract_cuesheet.cuesheet); - playlist->next = &playlist->cuesheet[0]; + playlist->next = playlist->cuesheet.data(); playlist->parser = std::make_unique(); return playlist;