@@ -92,7 +92,7 @@ static bool GetFileDescriptorProto(PyObject* py_descriptor,
9292}
9393
9494// Find a file by file name.
95- bool PyDescriptorDatabase::FindFileByName (const std::string& filename,
95+ bool PyDescriptorDatabase::FindFileByName (StringViewArg filename,
9696 FileDescriptorProto* output) {
9797 ScopedPyObjectPtr py_descriptor (PyObject_CallMethod (
9898 py_database_, " FindFileByName" , " s#" , filename.c_str (), filename.size ()));
@@ -101,7 +101,7 @@ bool PyDescriptorDatabase::FindFileByName(const std::string& filename,
101101
102102// Find the file that declares the given fully-qualified symbol name.
103103bool PyDescriptorDatabase::FindFileContainingSymbol (
104- const std::string& symbol_name, FileDescriptorProto* output) {
104+ StringViewArg symbol_name, FileDescriptorProto* output) {
105105 ScopedPyObjectPtr py_descriptor (
106106 PyObject_CallMethod (py_database_, " FindFileContainingSymbol" , " s#" ,
107107 symbol_name.c_str (), symbol_name.size ()));
@@ -112,7 +112,7 @@ bool PyDescriptorDatabase::FindFileContainingSymbol(
112112// with the given field number.
113113// Python DescriptorDatabases are not required to implement this method.
114114bool PyDescriptorDatabase::FindFileContainingExtension (
115- const std::string& containing_type, int field_number,
115+ StringViewArg containing_type, int field_number,
116116 FileDescriptorProto* output) {
117117 ScopedPyObjectPtr py_method (
118118 PyObject_GetAttrString (py_database_, " FindFileContainingExtension" ));
@@ -132,7 +132,7 @@ bool PyDescriptorDatabase::FindFileContainingExtension(
132132// order.
133133// Python DescriptorDatabases are not required to implement this method.
134134bool PyDescriptorDatabase::FindAllExtensionNumbers (
135- const std::string& containing_type, std::vector<int >* output) {
135+ StringViewArg containing_type, std::vector<int >* output) {
136136 ScopedPyObjectPtr py_method (
137137 PyObject_GetAttrString (py_database_, " FindAllExtensionNumbers" ));
138138 if (py_method == nullptr ) {
0 commit comments