Skip to content

Commit 652c44f

Browse files
author
DvirDukhan
committed
make format
1 parent d672e6a commit 652c44f

File tree

2 files changed

+24
-26
lines changed

2 files changed

+24
-26
lines changed

src/command_parser.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,8 @@ static int _ScriptRunCommand_ParseArgs(RedisModuleCtx *ctx, RedisModuleString **
198198
*runkey = argv[argpos];
199199

200200
const char *arg_string = RedisModule_StringPtrLen(argv[++argpos], NULL);
201-
if (!strcasecmp(arg_string, "TIMEOUT") || !strcasecmp(arg_string, "INPUTS") || !strcasecmp(arg_string, "OUTPUTS")) {
201+
if (!strcasecmp(arg_string, "TIMEOUT") || !strcasecmp(arg_string, "INPUTS") ||
202+
!strcasecmp(arg_string, "OUTPUTS")) {
202203
RAI_SetError(error, RAI_ESCRIPTRUN, "ERR function name not specified");
203204
return REDISMODULE_ERR;
204205
}
@@ -213,7 +214,7 @@ static int _ScriptRunCommand_ParseArgs(RedisModuleCtx *ctx, RedisModuleString **
213214
while (++argpos < argc) {
214215
arg_string = RedisModule_StringPtrLen(argv[argpos], NULL);
215216

216-
// Parse timeout arg if given and store it in timeout
217+
// Parse timeout arg if given and store it in timeout
217218
if (!strcasecmp(arg_string, "TIMEOUT") && !timeout_set) {
218219
if (_parseTimeout(argv[++argpos], error, timeout) == REDISMODULE_ERR)
219220
return REDISMODULE_ERR;

src/libtorch_c/torch_extensions/torch_redis.h

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,34 @@
33
#include "torch/csrc/jit/frontend/resolver.h"
44

55
namespace torch {
6-
namespace jit {
7-
namespace script {
8-
struct RedisResolver : public Resolver {
9-
10-
std::shared_ptr<SugaredValue> resolveValue(const std::string& name, Function& m, const SourceRange& loc) override {
11-
if(strcasecmp(name.c_str(), "torch") == 0) {
12-
return std::make_shared<BuiltinModule>("aten");
13-
}
14-
else if (strcasecmp(name.c_str(), "redis") == 0) {
15-
return std::make_shared<BuiltinModule>("redis");
16-
}
17-
return nullptr;
18-
}
6+
namespace jit {
7+
namespace script {
8+
struct RedisResolver : public Resolver {
199

20-
TypePtr resolveType(const std::string& name, const SourceRange& loc) override {
21-
return nullptr;
22-
}
23-
24-
};
25-
inline std::shared_ptr<RedisResolver> redisResolver() {
26-
return std::make_shared<RedisResolver>();
27-
}
10+
std::shared_ptr<SugaredValue> resolveValue(const std::string &name, Function &m,
11+
const SourceRange &loc) override {
12+
if (strcasecmp(name.c_str(), "torch") == 0) {
13+
return std::make_shared<BuiltinModule>("aten");
14+
} else if (strcasecmp(name.c_str(), "redis") == 0) {
15+
return std::make_shared<BuiltinModule>("redis");
2816
}
17+
return nullptr;
2918
}
30-
}
3119

20+
TypePtr resolveType(const std::string &name, const SourceRange &loc) override {
21+
return nullptr;
22+
}
23+
};
24+
inline std::shared_ptr<RedisResolver> redisResolver() { return std::make_shared<RedisResolver>(); }
25+
} // namespace script
26+
} // namespace jit
27+
} // namespace torch
3228

3329
// c10::intrusive_ptr<RedisValue> redisExecute(std::string fn_name, std::vector<std::string> args );
3430

35-
torch::IValue redisExecute(std::string fn_name, std::vector<std::string> args );
31+
torch::IValue redisExecute(std::string fn_name, std::vector<std::string> args);
3632
torch::List<torch::IValue> asList(torch::IValue);
3733

38-
static auto registry = torch::RegisterOperators("redis::execute", &redisExecute).op("redis::asList", &asList);
34+
static auto registry =
35+
torch::RegisterOperators("redis::execute", &redisExecute).op("redis::asList", &asList);
3936
// registry = torch::RegisterOperators("torch::asList", &asList);

0 commit comments

Comments
 (0)