Си диез / Говнокод #3397 Ссылка на оригинал

0

  1. 1
  2. 2
  3. 3
  4. 4
  5. 5
  6. 6
  7. 7
  8. 8
  9. 9
  10. 10
  11. 11
  12. 12
  13. 13
  14. 14
  15. 15
  16. 16
  17. 17
public static string ConvertBase64ToString(string b64)
        {
            string Value = b64;
            if (Value != null && Value.Length > 0)
            {
                System.Text.ASCIIEncoding encoder = new System.Text.ASCIIEncoding();
                System.Text.Decoder decoder = encoder.GetDecoder();
                byte[] bytes = Convert.FromBase64String(Value);
                int charCount = decoder.GetCharCount(bytes, 0, bytes.Length);
                char[] chars = new char[charCount];
                decoder.GetChars(bytes, 0, bytes.Length, chars, 0);
                string results = new String(chars);

                return results;
            }
            return string.Empty;
        }

не говоря уже про локальную переменную Value, весь блок заменяется на
return System.Text.ASCIIEncoding.ASCII.GetStrin g(Convert.FromBase64String(Value));

Запостил: eval_2009 eval_2009, (Updated )

Комментарии (6) RSS

  • return convert(foo(bar(func(abc(blah(blah(var)) )))+1))
    Удачи в отладке и переделке.
    Ответить
  • знай и люди свой API.
    всех 70-536 сдавать заставить
    Ответить
  • Хотел оставить комментарий, но вот это повеселило:

    "Я, Bjarne_Stroustrup, находясь в здравом уме и твердой памяти, торжественно заявляю:"
    Ответить

Добавить комментарий

Помни, guest, за тобой могут следить!

    А не использовать ли нам bbcode?


    8