From 9c0ddbba15f378ec6c733c8320d7ccb02721fc42 Mon Sep 17 00:00:00 2001 From: Timo Kreuzer Date: Wed, 27 Aug 2008 01:47:34 +0000 Subject: [PATCH] Optimize and shorten StringCxxLength svn path=/branches/ros-amd64-bringup/; revision=35691 --- reactos/include/psdk/strsafe.h | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/reactos/include/psdk/strsafe.h b/reactos/include/psdk/strsafe.h index 99fbc493a56..248c9afc2b4 100644 --- a/reactos/include/psdk/strsafe.h +++ b/reactos/include/psdk/strsafe.h @@ -286,11 +286,7 @@ STRSAFEAPI StringCxxLength(STRSAFE_LPCTSTR psz, size_t cxMax, size_t *pcx) return STRSAFE_E_INVALID_PARAMETER; } - while (*psz != 0 && cch != 0) - { - cch--; - psz++; - } + for (--psz; *(++psz) != 0 && --cch > 0;); if (cch == 0) {