Skip to content

Commit 738aad1

Browse files
committed
Clarify algorithmic difficulty for web::json::value::string overloads.
1 parent 2280f05 commit 738aad1

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

Release/include/cpprest/json.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,22 @@ namespace web { namespace json
198198
/// </summary>
199199
/// <param name="value">The C++ value to create a JSON value from</param>
200200
/// <returns>A JSON string value</returns>
201+
/// <remarks>
202+
/// This overload has O(n) performance because it tries to determine if
203+
/// specified string has characters that should be properly escaped in JSON.
204+
/// <remarks>
201205
static _ASYNCRTIMP value __cdecl string(utility::string_t value);
202206

203207
/// <summary>
204-
/// Creates a string value
208+
/// Creates a string value specifying if the string contains characters to escape
205209
/// </summary>
206210
/// <param name="value">The C++ value to create a JSON value from</param>
207-
/// <param name="has_escape_chars">Whether <paramref name="value" /> contains characters that should be escaped in JSON value</param>
211+
/// <param name="has_escape_chars">Whether <paramref name="value" /> contains characters
212+
/// that should be escaped in JSON value</param>
208213
/// <returns>A JSON string value</returns>
214+
/// <remarks>
215+
/// This overload has O(1) performance.
216+
/// </remarks>
209217
static _ASYNCRTIMP value __cdecl string(utility::string_t value, bool has_escape_chars);
210218

211219
#ifdef _MS_WINDOWS

0 commit comments

Comments
 (0)