ext/zstdruby/common.h in zstd-ruby-1.5.2.2 vs ext/zstdruby/common.h in zstd-ruby-1.5.2.3
- old
+ new
@@ -2,7 +2,14 @@
#define ZSTD_RUBY_H 1
#include "ruby.h"
#include "./libzstd/zstd.h"
+static int convert_compression_level(VALUE compression_level_value)
+{
+ if (NIL_P(compression_level_value)) {
+ return ZSTD_CLEVEL_DEFAULT;
+ }
+ return NUM2INT(compression_level_value);
+}
#endif /* ZSTD_RUBY_H */