Make params const and pass by ref

This commit is contained in:
amaitland
2015-11-18 18:39:36 +10:00
parent 3f15b53ab7
commit 401dd969fc
2 changed files with 8 additions and 8 deletions
@@ -18,17 +18,14 @@ namespace CefSharp
namespace Serialization
{
template<typename TList, typename TIndex>
void SerializeV8SimpleObject(Object^ obj, CefRefPtr<TList> list, TIndex index, Stack<Object^>^ seen);
template<typename TList, typename TIndex>
void SerializeV8Object(Object^ obj, CefRefPtr<TList> list, TIndex index)
void SerializeV8Object(Object^ obj, const CefRefPtr<TList>& list, const TIndex& index)
{
auto seen = gcnew Stack<Object^>();
SerializeV8SimpleObject(obj, list, index, seen);
}
template<typename TList, typename TIndex>
void SerializeV8SimpleObject(Object^ obj, CefRefPtr<TList> list, TIndex index, Stack<Object^>^ seen)
void SerializeV8SimpleObject(Object^ obj, const CefRefPtr<TList>& list, const TIndex& index, Stack<Object^>^ seen)
{
list->SetNull(index);
@@ -143,8 +140,8 @@ namespace CefSharp
return CefTime(timeSpan.TotalSeconds);
}
template void SerializeV8Object(Object^ obj, CefRefPtr<CefListValue> list, int index);
template void SerializeV8Object(Object^ obj, CefRefPtr<CefDictionaryValue> list, CefString index);
template void SerializeV8Object(Object^ obj, const CefRefPtr<CefListValue>& list, const int& index);
template void SerializeV8Object(Object^ obj, const CefRefPtr<CefDictionaryValue>& list, const CefString& index);
}
}
}
@@ -14,7 +14,10 @@ namespace CefSharp
//Serializes data into a given position in a CefListValue or CefDictionaryValue
template<typename TList, typename TIndex>
void SerializeV8Object(Object^ obj, CefRefPtr<TList> list, TIndex index);
void SerializeV8Object(Object^ obj, const CefRefPtr<TList>& list, const TIndex& index);
template<typename TList, typename TIndex>
void SerializeV8SimpleObject(Object^ obj, const CefRefPtr<TList>& list, const TIndex& index, Stack<Object^>^ seen);
}
}
}