Skip to content

Commit

Permalink
Merge pull request #1902 from berryzplus/feature/remove_useless_if_br…
Browse files Browse the repository at this point in the history
…anches

無駄なif分岐を削除
  • Loading branch information
berryzplus committed Jan 16, 2023
2 parents 3e2543a + ff860ee commit 9e46551
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 60 deletions.
13 changes: 3 additions & 10 deletions sakura_core/charset/codechecker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,16 +635,9 @@ int CheckUtf8Char( const char *pS, const int nLen, ECharSet *peCharset, const bo

// 非文字と予約コードポイントをチェック
if( nOption != 0 && echarset != CHARSET_BINARY ){
wchar32_t wc32;
wc32 = DecodeUtf8( reinterpret_cast<const unsigned char*>(pS), ncwidth );
if( (nOption & UC_NONCHARACTER) && IsUnicodeNoncharacter(wc32) ){
echarset = CHARSET_BINARY;
ncwidth = 1;
}else{
// 保護コード
echarset = CHARSET_BINARY;
ncwidth = 1;
}
// 保護コード
echarset = CHARSET_BINARY;
ncwidth = 1;
}

if( peCharset ){
Expand Down
12 changes: 1 addition & 11 deletions sakura_core/cmd/CViewCommander_Clipboard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -976,17 +976,7 @@ void CViewCommander::Command_COPY_COLOR_HTML(bool bLineNumber)
bool bAddLineNum = true;
const CLayout* pcLayoutNext = pcLayout->GetNextLayout();
if( pcLayoutNext ){
if( type.m_bLineNumIsCRLF ){
if( bLineNumLayout && pcLayoutNext->GetLogicOffset() != 0 ){
bAddLineNum = true;
}else{
bAddLineNum = true;
}
}else{
if( bLineNumLayout || pcLayoutNext->GetLogicOffset() == 0 ){
bAddLineNum = true;
}
}
bAddLineNum = type.m_bLineNumIsCRLF || bLineNumLayout || pcLayoutNext->GetLogicOffset() == 0;
}
if( bAddLineNum ){
if( sFontAttrLast2.m_bBoldFont ){
Expand Down
7 changes: 1 addition & 6 deletions sakura_core/cmd/CViewCommander_Cursor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1145,12 +1145,7 @@ void CViewCommander::Command_GOPREVPARAGRAPH( bool bSelect )
}
else {
// いま見ているところは空行の1行目
if ( GetDllShareData().m_Common.m_sGeneral.m_bStopsBothEndsWhenSearchParagraph ){ // 段落の両端で止まる
nCaretPointer++;
}
else {
nCaretPointer++;
}
nCaretPointer++;
}

// EOFまで来たり、目的の場所まできたので移動終了。
Expand Down
15 changes: 4 additions & 11 deletions sakura_core/convert/convert_util2.h
Original file line number Diff line number Diff line change
Expand Up @@ -400,17 +400,10 @@ bool CheckUUHeader( const CHAR_TYPE *pSrc, const int nLen, WCHAR *pszFilename )
int nwlen, nstartidx;
CHAR_TYPE pszSplitChars[16];

if( sizeof(CHAR_TYPE) == 2 ){
// スペースまたはタブが区切り文字
pszSplitChars[0] = L' ';
pszSplitChars[1] = L'\t';
pszSplitChars[2] = L'\0';
}else{
// スペースまたはタブが区切り文字
pszSplitChars[0] = ' ';
pszSplitChars[1] = '\t';
pszSplitChars[2] = '\0';
}
// スペースまたはタブが区切り文字
pszSplitChars[0] = ' ';
pszSplitChars[1] = '\t';
pszSplitChars[2] = '\0';

if( nLen < 1 ){
if( pszFilename ){
Expand Down
13 changes: 2 additions & 11 deletions sakura_core/dlg/CDlgTagJumpList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,7 @@ bool CDlgTagJumpList::GetFullPathAndLine( int index, WCHAR *fullPath, int count,
AddLastYenFromDirectoryPath( dirFileName );
const WCHAR *p = fileName;
if( p[0] == L'\\' ){
if( p[1] == L'\\' ){
wcscpy( dirFileName, p );
}else{
wcscpy( dirFileName, p );
}
wcscpy( dirFileName, p );
}else if( _istalpha( p[0] ) && p[1] == L':' ){
wcscpy( dirFileName, p );
}else{
Expand Down Expand Up @@ -1638,12 +1634,7 @@ WCHAR* CDlgTagJumpList::GetFullPathFromDepth( WCHAR* pszOutput, int count,
//完全パス名を作成する。
const WCHAR *p = fileName;
if( p[0] == L'\\' ){ //ドライブなし絶対パスか?
if( p[1] == L'\\' ){ //ネットワークパスか?
wcscpy( pszOutput, p ); //何も加工しない。
}else{
//ドライブ加工したほうがよい?
wcscpy( pszOutput, p ); //何も加工しない。
}
wcscpy( pszOutput, p ); //何も加工しない。
}else if( _istalpha( p[0] ) && p[1] == L':' ){ //絶対パスか?
wcscpy( pszOutput, p ); //何も加工しない。
}else{
Expand Down
12 changes: 1 addition & 11 deletions sakura_core/typeprop/CPropTypesRegex.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,7 @@ INT_PTR CPropTypesRegex::DispatchEvent(
if( CheckRegexpVersion( hwndDlg, IDC_LABEL_REGEX_VERSION, false ) == false ) //@@@ 2001.11.17 add MIK
{
::DlgItem_SetText( hwndDlg, IDC_LABEL_REGEX_VERSION, LS(STR_PROPTYPEREGEX_NOUSE) );
//ライブラリがなくて、使用しないになっている場合は、無効にする。
if( ! IsDlgButtonChecked( hwndDlg, IDC_CHECK_REGEX ) )
{
//Disableにする。
EnableWindow( GetDlgItem( hwndDlg, IDC_CHECK_REGEX ), FALSE );
}
else
{
//使用するになってるんだけどDisableにする。もうユーザーは変更できない。
EnableWindow( GetDlgItem( hwndDlg, IDC_CHECK_REGEX ), FALSE );
}
EnableWindow( GetDlgItem( hwndDlg, IDC_CHECK_REGEX ), FALSE );
}
return TRUE;

Expand Down

0 comments on commit 9e46551

Please sign in to comment.