Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitdcc1b72

Browse files
authored
Remove string allocation from hot path (#605)
1 parent9e5e8b6 commitdcc1b72

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

‎pgml-extension/src/bindings/venv.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ use pyo3::prelude::*;
77
use pyo3::types::PyTuple;
88
use std::ffi::CStr;
99

10+
staticCONFIG_NAME:&'staticstr ="pgml.venv";
11+
1012
staticPY_MODULE:Lazy<Py<PyModule>> =Lazy::new(||{
1113
Python::with_gil(|py| ->Py<PyModule>{
1214
let src =include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/src/bindings/venv.py"));
@@ -28,8 +30,7 @@ pub fn activate_venv(venv: &str) -> bool {
2830

2931
pubfnactivate() ->bool{
3032
unsafe{
31-
let config_name ="pgml.venv".to_string();
32-
let option = pgrx_pg_sys::GetConfigOption(config_name.as_pg_cstr(),true,false);
33+
let option = pgrx_pg_sys::GetConfigOption(CONFIG_NAME.as_pg_cstr(),true,false);
3334
if option.is_null(){
3435
false
3536
}else{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp