From 52729973a2e9fe2816f2cadc4497222091823f10 Mon Sep 17 00:00:00 2001 From: Alexander Zhirov Date: Fri, 12 Sep 2025 21:04:08 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9E=D0=B1=D0=BD=D0=BE=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B0=D1=82=D1=80=D0=B8=D0=B1=D1=83=D1=82?= =?UTF-8?q?=D0=BE=D0=B2=20=D1=84=D1=83=D0=BD=D0=BA=D1=86=D0=B8=D0=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/cdcdb/cdc/cas.d | 4 ++-- source/cdcdb/cdc/core.d | 4 ++-- source/cdcdb/cdc/types.d | 2 +- test/app.d | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/cdcdb/cdc/cas.d b/source/cdcdb/cdc/cas.d index e39128a..0a19508 100644 --- a/source/cdcdb/cdc/cas.d +++ b/source/cdcdb/cdc/cas.d @@ -131,7 +131,7 @@ public: return idSnapshot; } - Snapshot[] getSnapshots(string label = "") + Snapshot[] getSnapshots(string label = string.init) { return _db.getSnapshots(label); } @@ -178,7 +178,7 @@ public: ok = true; } - string getVersion() { + string getVersion() const @safe nothrow { import cdcdb.version_; return cdcdbVersion; } diff --git a/source/cdcdb/cdc/core.d b/source/cdcdb/cdc/core.d index a5cbe19..d95f13d 100644 --- a/source/cdcdb/cdc/core.d +++ b/source/cdcdb/cdc/core.d @@ -13,7 +13,7 @@ private: // _gear mixin(import("gear.d")); - size_t cut(const(ubyte)[] src) @safe nothrow + size_t cut(const(ubyte)[] src) pure nothrow @safe @nogc { size_t size = src.length; if (size == 0) @@ -67,7 +67,7 @@ public: _maskL = maskL; } - Chunk[] split(const(ubyte)[] data) @safe + Chunk[] split(const(ubyte)[] data) @safe nothrow { Chunk[] chunks; if (data.length == 0) diff --git a/source/cdcdb/cdc/types.d b/source/cdcdb/cdc/types.d index 8cd809d..cfede4c 100644 --- a/source/cdcdb/cdc/types.d +++ b/source/cdcdb/cdc/types.d @@ -6,5 +6,5 @@ struct Chunk size_t index; // 1..N size_t offset; // смещение в исходном буфере size_t size; // размер чанка - ubyte[32] sha256; // hex(SHA-256) содержимого + immutable(ubyte)[32] sha256; // hex(SHA-256) содержимого } diff --git a/test/app.d b/test/app.d index 79829d4..919d8c8 100644 --- a/test/app.d +++ b/test/app.d @@ -7,7 +7,7 @@ import std.file : read; void main() { auto cas = new CAS("/tmp/base.db", true); - cas.newSnapshot("/tmp/texts", cast(ubyte[]) read("/tmp/text")); + cas.newSnapshot("/tmp/text", cast(ubyte[]) read("/tmp/text")); // import std.stdio : writeln; foreach (snapshot; cas.getSnapshots()) {